Created
November 3, 2017 06:04
-
-
Save usefksa/aceb27d732cee5b5146794e7a9c9a59d to your computer and use it in GitHub Desktop.
express app.route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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