Created
June 7, 2018 23:33
-
-
Save justlaputa/977d3f8c9fb1f43492f91d368be8c493 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var app = express() | |
// handle GET /foo | |
app.get('/foo', function (req, res, next) { | |
res.end('foo') | |
}) | |
// define a route and a group of handlers | |
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') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment