Home » » Node.Js Tutorial For Beginners 21 - Express.Js Road Parameter

Node.Js Tutorial For Beginners 21 - Express.Js Road Parameter



var limited = require('express'); var app = express();  app.get('/', function(req, rep) {     rep.send('this is abode page'); })  app.get('/about', function(req, rep) {     rep.send('this is close page'); })  app.get('/contect', function(req, rep) {     rep.send('this is contect page'); })  var students = {     1 : 'Mark',     2 : 'Tom',     3 : 'john' }  app.get('/students/:id', function(req, rep) {     rep.send('you accept requested to run into the pupil mention : '+ students[req.params.id]); })  app.listen(3000, function() {     console.log('our server is alive on posrt 3000'); }) 

0 comments:

Post a Comment

Search

Blog Archive