Express4 ejs template include relative path problem?

  node.js, question

I would like to introduce the header.html of the relative path under these views
es.render()
ejs.render()
Is there any difference between the two?
The latter cannot be used at all. But the official API says so. Not very understanding

Officials say how to configure filename?

You can set the path of views first:

app.set('views', path.join(__dirname, 'views'));

In this way, the calculation will start from views by default.

res.render('index',{
 title:'index'
 });

The index here should have been:

res.render('views/index.ejs',{
 title:'index'
 });

However, you can simplify the configuration by setting the default starting path of views and the default template engine.