1// send the rendered view to the client
2res.render('index')
3
4// if a callback is specified, the rendered HTML string has to be sent explicitly
5res.render('index', function (err, html) {
6 res.send(html)
7})
8
9// pass a local variable to the view
10res.render('user', { name: 'Tobi' }, function (err, html) {
11 // ...
12})
13
1// here you set that all templates are located in `/views` directory
2app.set('views', __dirname + '/views');
3
4// here you set that you're using `ejs` template engine, and the
5// default extension is `ejs`
6app.set('view engine', 'ejs');
7
8// here you render `orders` template
9response.render("orders", {orders: orders_json});
10