When I run node from my app directory, namely:
#(not in /var/www/html)
GET /auth/login 500 32.511 ms - 2206
Error: Failed to lookup view "login" in views directory "/home/ec2-user/views"
This will most likely happen if you define paths like e.g. for the template engine like:
. it looks up the directory from where you launched the app.
You need to use
app.set('views', __dirname + '/views');
in order to search the views directory in the script's folder. As also explained here: What is the difference between __dirname and ./ in node.js?