install pug view engine use
npm install pug
const express = require('express');
const app = express();
app.use(express.json());
app.set('view engine','pug');
app.set('views','./views');
var port = 3001;
app.get('/index', (req,resp) => {
resp.render('index');
});
app.listen(port,() => {
console.log('app started');
});
create 'index.pug' and place this file inner views folder:
html
head
title node js in action
body
h1 learning html templating with pug view engine
result:
thanks for visit, please visit my partner website in ekstrasoris




