Express.js multiple methods

前端 未结 4 2120
别跟我提以往
别跟我提以往 2021-01-12 02:30

So in Express you can do:

app.get(\'/logo/:version/:name\', function (req, res, next) {
    // Do something
}    

and

app.a         


        
4条回答
  •  孤独总比滥情好
    2021-01-12 03:08

    another version:

    ['get','head'].forEach(function(method){
      app[method]('/logo/:version/:name', function (req, res, next) {
        // Do something
      });
    });
    

提交回复
热议问题