javascript - Express route handle for admin and admin/* with same routes -


my admin/whatever url rendering admin file when try hit admin show 404 not go in route. can create separate route url/admin other option. manage single route .

  app.get('/admin/*', function (req, res, next) {        res.render('admin');     }); 

remove / after admin can match route

app.get('/admin*', function (req, res, next) {        res.render('admin');   }); 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

meteor - inserting data to database gives error "insert failed: Method '/texts/insert' not found" -

php - Cannot override Laravel Spark authentication with own implementation -