ExpressJS route regex

后端 未结 4 1158
别跟我提以往
别跟我提以往 2021-01-11 19:42

I have route:

app.get(\'/:id\', routes.action);

It works fine, but I need skip robot.txt and other (humans ....) I create rege

4条回答
  •  执念已碎
    2021-01-11 20:17

    If you need it for multiple routes :

    app.routes.get 
    

    is an array having all of the get routes. You can change the regex object for the routes you need to change.

提交回复
热议问题