Program:
Output:
var express = require('express'); const { response } = require('express'); const { request } = require('http'); var app = express(); app.get('/home',function(request,response){ response.send("This is my HomePage"); }); app.get('/posts/:id',function(request,response){ response.send("This is post: "+ request.params.id); }); app.listen(5000);
Output: