Monday, 24 April 2017

Difference between adding route keyword in defining route in Express

What is the difference between

router.route('/create') .post(validate(hotelValidation.createHotel), function (req, res) {

and simply

router.post('/create', validate(hotelValidation.createHotel), function (req, res) {

Are these the same? What does the route keyword accomplish here?



via Solly

No comments:

Post a Comment