84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
The code is as shown in the figure. The expected result should be that the title has changed and the title is named node.But in actual operation, the title is <%= title %>, which means the template engine does not work?
ringa_lee
It seems that your index.js does not have a template engine set? Like the jade template engine, html files should be .jade files, not .html.
I agree with you, should I save the index.html file as an index.jade file? The jade template has been upgraded, save it as index.pug and try it.
gg, my mistake, the brackets were placed in the wrong place, disturbing everyone.
app.use(views(path.join(__dirname, './views'), { map: { html: 'underscore' } }))
Just change it to this way
It seems that your index.js does not have a template engine set? Like the jade template engine, html files should be .jade files, not .html.
I agree with you, should I save the index.html file as an index.jade file? The jade template has been upgraded, save it as index.pug and try it.
gg, my mistake, the brackets were placed in the wrong place, disturbing everyone.
Just change it to this way