Why do I must specify the extension, if the docs say i dont should specify the extension (express)


You are watching: No default engine was specified and no extension was provided


This functions :

app.set('views', './views' );app.set('view-engine', 'jade'); app.get('/j', function(req, res) res.render('somepage.jade', title:'yeah...', message:'It works'););This does not : (no .jade extension.)

app.set('views', './views' );app.set('view-engine', 'jade'); app.get('/j', function(req, res) res.render('somepage', title:'yeah...', message:'It works'););But the docs say :

http://expressjs.com/guide/using-template-engines.htmlIf the see engine building is no set, you will need to specify the expansion of the see file, else you can omit it.

Which renders me think the not, especially since the error is :

Error: No default engine was specified and also no expansion was provided.

I assumed this collection it :

app.set('view-engine', 'jade');
3 comments
share
save
hide
report
50% Upvoted
Log in or authorize up to leave a comment
Log InSign Up
Sort by: best

level 1
· 6y
I'm pretty sure it's "view engine", no "view-engine"

See the settings list: http://expressjs.com/4x/api.html#app.set


5
Reply
Share
ReportSave
level 2
Op · 6y

....damnit


3
Reply
Share
ReportSave
level 2
· 6y

Yep, absolutely view engine rather of view-engine.


1
Reply
Share
ReportSave
*

r/node
Welcome come node
199k

Members


188

Online


Created Dec 16, 2009
Join
*
*
*
*

*

Top short articles july 13th 2015Top posts of july, 2015Top short articles 2015
helpsommos.net coinssommos.net premiumsommos.net gifts
aboutcareerspressadvertiseblogTermsContent policyPrivacy policyMod policy


See more: ' Normal People Is A Love Story To Cherish, Perish, Normal People By Sally Rooney

Back come Top