ringa_lee
Express needs to use the body-parser middleware to parse the body
var express = require('express') var bodyParser = require('body-parser') var app = express() var jsonParser = bodyParser.json() var urlencodedParser = bodyParser.urlencoded({ extended: false }) app.post('/login', urlencodedParser, function (req, res) { if (!req.body) return res.sendStatus(400) res.send('welcome, ' + req.body.username) })
soonfy
Express needs to use the body-parser middleware to parse the body
soonfy