Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

pass data ino pug nodejs

1) Use this first

app.set('views', __dirname + '/public/views');
app.set('view engine', 'pug');

2) Then pass this to first visit

app.get('/', function (req, res) {
    res.render('index', { title: 'Hey', message: 'Hello there!'});
});

3) Then echo in template file "index.pug" in "/public/views"

html
   head
   title= title
body
   h1= message
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pass #data #ino #pug #nodejs
ADD COMMENT
Topic
Name
8+2 =