app.post()

app.post(path, callback [, callback ...])

Routes HTTP POST requests to the specified path with the specified callback functions. For more information, see the routing guide.

You can provide multiple callback functions that behave just like middleware, except that these callbacks can invoke next('route') to bypass the remaining route callback(s). You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there’s no reason to proceed with the current route.

app.post('/', function (req, res) {
  res.send('POST request to homepage');
});
doc_Express
2016-05-02 16:34:31
Comments
Leave a Comment

Please login to continue.