Geeting error Cannot GET /greet/sanchi on calling localhost:2121/greet/sanchi but when am writing localhost:2121 the page is sucessfully printing hello

let express=require(‘express’)
let server=express()
console.log(“hey”)
server.get(’/’,function(req,res,next){
res.send(“hello”)

})
server.get(’/greet/:name’ ,function(req,res,next){
console.log(“yo1”)

res.send("hello there"+req.params.name)

})
server.listen(2121)

code is correct and it should work, reason why it is not working may be any one of the following:

  • your file may not be saved
  • there might be some error in inverted commas or quotation mark