express app.poist code example
Example 1: node js express url parameters
// http://localhost:8080/api/1
app.get('/api/:version', function(req, res) {
res.send(req.params.version);
});
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