app
- 路径严格模式配置
let app = express()
app.set('strict routing', true)
// 启动严格模式后 /test 和 /test/是不通路径
- 区分大小写配置
let app = express()
app.set('case sensitive routing', true)
- app.param:把参数单数拿出来处理
app.param('id', function(req,res,next,value){
... //id就是value
})
等同于 下面的param的 id
app.get('.user/:id', function(req,res){
...
})
本文介绍了Express框架中路径严格模式及大小写敏感配置的方法,并演示了如何使用app.param处理路由参数。
870

被折叠的 条评论
为什么被折叠?



