Created
November 30, 2015 23:38
-
-
Save yamikuronue/d307e44f2d17c086a6b4 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
//Set up middleware | |
const bodyParser = require('body-parser'); | |
let jsonParser = bodyParser.json(); | |
//Attach to route | |
app.route('/api/boards') | |
.get(cApi.getAllBoards) | |
.post(jsonParser, cApi.addBoard) | |
.patch((_, res) => res.status(405).end()) | |
.delete((_, res) => res.status(405).end()) | |
.put((_, res) => res.status(405).end()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment