expressjs bind all routes except 2 folders?
问题 In expressjs, how do I bind a route to all urls except /static and /fail For example, it sound bind to: /users /books /books/anything but not bind to /static /fail /fail/anything /static/anything 回答1: If you are saying you want to create one route for everything but /static* then here is the command for creating the GET route: app.get(/^((?!\/static).)*$/, function(req, res){ //Do your thing in here... }); 回答2: My question was just slightly different and this was the best question/answer