美文网首页
express.Router&&express.route的区别

express.Router&&express.route的区别

作者: HymanChen | 来源:发表于2020-02-06 13:57 被阅读0次

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的区别

      本文链接:https://www.haomeiwen.com/subject/fnayxhtx.html