I need to have two routes, they are similar in the start but different in ends, how can I enforce the exact pattern for the respective route to be called.
Edit - Actually the problem lies in the app.use
statement, I've not reached the get route yet.
A)
app.get("/admin/event/:id/sessions", function(request, response){
B)
app.get("/admin/event/:id", function(request, response){
C)
app.use("/admin/event/:id", function(request, response, next){
D)
app.use("/admin/event/:id/sessions", function(request, response, next){
C is getting called for the request GET /admin/event/1/sessions
, my expectation is that D should be getting called. Please advise.