express.Router&&express.route的区别

app.route(path)

Returns an instance of a single route, which you can then use to handle HTTP verbs with optional middleware. !路由----一条从A~B的路径!

express.Router([options])

Creates a new router object.!路由器----路由N条类似从A~B的路径!


这两个的区别好比路由器和路由的区别,路由器可以拥有很多路由!

你可能感兴趣的:(express.Router&&express.route的区别)