Differences between express.Router and app.get?

前端 未结 8 1035
终归单人心
终归单人心 2020-11-29 14:24

I\'m starting with NodeJS and Express 4, and I\'m a bit confused. I been reading the Express website, but can\'t see when to use a route handler or when to use

8条回答
  •  星月不相逢
    2020-11-29 15:09

    express.Router has many options:

    • enable case sensitivity: /show route to not be the same as /Show, this behavior is disabled by default
    • strict routing mode: /show/ route to not the same as /show, this behavior is also disabled by default
    • we can add specific middleware/s to specific routes

提交回复
热议问题