Created
October 6, 2015 01:23
-
-
Save hartzis/8aefb1c9ab5bd7635a52 to your computer and use it in GitHub Desktop.
node side fetch example with express and body-parser
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
let router = require('express').Router(); | |
let bodyParser = require('body-parser'); | |
// parse application/json | |
router.use(bodyParser.json()); | |
router.put('/api/update', update); | |
function update(req, res) { | |
console.log('updating-', req.body); | |
res.sendStatus(200); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment