Skip to content

Instantly share code, notes, and snippets.

@hartzis
Created October 6, 2015 01:23
Show Gist options
  • Save hartzis/8aefb1c9ab5bd7635a52 to your computer and use it in GitHub Desktop.
Save hartzis/8aefb1c9ab5bd7635a52 to your computer and use it in GitHub Desktop.
node side fetch example with express and body-parser
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