I am working through setting up a http server using node.js and engine. However, I keep running into issues that I have little information on how to resolve I would apprecia
Error: No default engine was specified and no extension was provided
I got the same problem(for doing a mean stack project)..the problem is i didn't mentioned the formate to install npm i.e; pug or jade,ejs etc. so to solve this goto npm and enter express --view=pug foldername. This will load necessary pug files(index.pug,layout.pug etc..) in ur given folder .
If you wish to render a html file, use:
response.sendfile('index.html');
Then you remove:
app.set('view engine', 'html');
Put your *.html
in the views
directory, or serve a public
directory as static dir and put the index.html
in the public
dir.