Skip to content

Instantly share code, notes, and snippets.

@youxiachai
Created July 8, 2014 06:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save youxiachai/e2bba835c2ef4850562b to your computer and use it in GitHub Desktop.
Save youxiachai/e2bba835c2ef4850562b to your computer and use it in GitHub Desktop.
express 中间件匹配用法..,注意位置!
app.use('/fsck', function (req, res, next){
console.log('fsck');
res.header("How-Old-Are-You", "Iamfinethinkyou");
next();
})
app.get('/fsck/fsck', function (res, res){
console.log('fsck');
res.send('ok')
})
@youxiachai
Copy link
Author

测试 curl -I host/fsck/fsck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment