Failed to lookup view "index.ejs" in views directory
You need to set your view
directory and your viewengine
before requesting any of your view files.
Hence you need to add the below lines, before your app.get
app.set('views', './views');
app.set('view engine', 'ejs');
And your res.render('index.ejs');
should be changed as,
res.render('index');
Hope this helps!