Created
November 5, 2018 17:12
-
-
Save koptionalsoftware/d40c30796bae0429684cbc7740b8df76 to your computer and use it in GitHub Desktop.
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
const express = require("express"); | |
const app = express(); | |
/** | |
* See https://expressjs.com/en/guide/routing.html#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'); | |
}) | |
.delete(function(req, res) { | |
res.send('Deleted a book'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment