TIM*_*MEX 1 regex node.js express
app.get('if it does not begin with /api', function(req,res){
//the path does not begin with "/api"
});
Run Code Online (Sandbox Code Playgroud)
我怎么写那个正则表达式?
您应该在JavaScript中使用正常的正则表达式,具有负前瞻性.试试这个:
app.get(/^(?!\/api).+/, function(req,res){
//the path does not begin with "/api"
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
577 次 |
| 最近记录: |