showing results for - "fetch api req body empty"
Mateo
05 Apr 2017
1var express    = require('express')
2var bodyParser = require('body-parser')
3
4var app = express()
5
6// parse application/x-www-form-urlencoded
7app.use(bodyParser.urlencoded())
8
9// parse application/json
10app.use(bodyParser.json())
11
12app.listen(2000);
13
14app.post("/", function (req, res) {
15  console.log(req.body) // populated!
16  res.send(200, req.body);
17});