Skip to content

Instantly share code, notes, and snippets.

@usefksa
Created November 3, 2017 06:04
Show Gist options
  • Save usefksa/aceb27d732cee5b5146794e7a9c9a59d to your computer and use it in GitHub Desktop.
Save usefksa/aceb27d732cee5b5146794e7a9c9a59d to your computer and use it in GitHub Desktop.
express app.route
app.route('/book')
.get(function (req, res) {
res.send('Get a random book')
})
.post(function (req, res) {
res.send('Add a book')
})
.put(function (req, res) {
res.send('Update the book')
})
//https://expressjs.com/en/guide/routing.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment