You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been working on a project and pretend using both EJS and Jade for it.
For this purpose, I thought separating stuff in multiple routers would work. However, when I tried to run it, I noticed the express.Router() does not include a router.set('view engine', 'ejs'). I am currently getting the files using fs and it works fine, but I really would like to have the advantages and simpler code that rendering with Express has.
The text was updated successfully, but these errors were encountered:
gtomitsuka
changed the title
Add .set() to Express Router
Add .set() to Express Router
Feb 21, 2015
Hi! We won't add .set and friends to routes, because it's one of the defining difference between routers (simply routing requests) and apps (having settings, methods, etc.). If you need different view engines for different parts of your project, consider simply using sub apps.
Hello,
I've been working on a project and pretend using both EJS and Jade for it.
For this purpose, I thought separating stuff in multiple routers would work. However, when I tried to run it, I noticed the
express.Router()
does not include arouter.set('view engine', 'ejs')
. I am currently getting the files usingfs
and it works fine, but I really would like to have the advantages and simpler code that rendering with Express has.The text was updated successfully, but these errors were encountered: