Express.js multiple methods

前端 未结 4 2079
别跟我提以往
别跟我提以往 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:23

    You can use .route() method.

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

提交回复
热议问题