express app param code example
Example 1: express js params
app.get('/path/:name', function(req, res) {
console.log(req.params.name);
});
app.get('/path', function(req, res) {
console.log(req.query['name']);
});
Example 2: express render
res.render('index')
res.render('index', function (err, html) {
res.send(html)
})
res.render('user', { name: 'Tobi' }, function (err, html) {
})
Example 3: response.render
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
response.render("orders", {orders: orders_json});