pass data ino pug nodejs

Solutions on MaxInterview for pass data ino pug nodejs by the best coders in the world

showing results for - "pass data ino pug nodejs"
Sara
28 May 2020
11) Use this first
2
3app.set('views', __dirname + '/public/views');
4app.set('view engine', 'pug');
5
62) Then pass this to first visit
7
8app.get('/', function (req, res) {
9    res.render('index', { title: 'Hey', message: 'Hello there!'});
10});
11
123) Then echo in template file "index.pug" in "/public/views"
13
14html
15   head
16   title= title
17body
18   h1= message