I want to use the same structure express gives (when generating like express appname) and inside views folder i want to use a normal html file. I can do this if I create main js file (app.js) by manually. but what i want to know is how can i change the app.js file which generated when creating a express as i want.
I did this code but its not working.
var express = require('express');
var path = require('path');
var app = express()
// my HTML file inside the views directory
app.set('views', path.join(__dirname, 'views'));
router.get('/', function(req, res) {
res.sendFile(__dirname + '/index.html');
});
I am getting this errors
Error: No default engine was specified and no extension was provided. at new View