express 如何将“/”,"/index","index.html"写到一个路由处理上,而不是写三遍?
express 如何将 router.get(“/”,function({})); router.get(“/index”,function({})); router.get(“/index.html”,function({})); 写到一个路由处理上,而不是写三遍?
20 回复
就 router 来说, 他是只支持一个 path 的 https://github.com/expressjs/express/blob/4.13.4/lib/router/index.js#L509