In index.js -------------------------------------------------------------------------------------------------- const express = require('express'); const app = express(); app.set('view engine', 'pug'); app.set('views', './views'); app.get('/', function(req, res){ //creating object of variables var person = { name = "Chandan", city = "Delhi", tutorial = "ExpressJs" }; res.render('example', { data : person }); }); app.listen(80); ----------------------------------------------------------------------------------------------------- In example.pug ----------------------------------------------------------------------------------------------------- doctype html html head If-Else Conditionals In PUG body if (data) ...
Comments
Post a Comment