view engine setup express 1

view engine setup express

// 'ejs' view engine setup in express.js application
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "views"));

Here is what the above code is Doing:
1. We are requiring the express module.
2. We are creating an express application.
3. We are setting the ‘views’ directory to be the directory where our views are located.
4. We are setting the ‘view engine’ to be ‘ejs’.

Similar Posts