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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -