what is express api code example
Example 1: sendfile express syntax
app.get('/', function(req, res){
res.sendFile('index.html');
});
Example 2: http header express
app.get('/', (req, res) => {
req.header('User-Agent')
})
// Use the Request.header() method to access
//one individual request header’s value
Example 3: express api
app.render('email', function (err, html) {
// ...
})
app.render('email', { name: 'Tobi' }, function (err, html) {
// ...
})