Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Express.js POST req.body empty

// Envirnoment variable
require('dotenv').config()
const express       = require('express')
const port          = process.env.PORT
const app           = express()
const cookieParser = require('cookie-parser')
app.use(express.json())
app.use(cookieParser())
router.post('/profile', (req, res) => {
  console.log(req.body);
});
app.listen(port, () => console.log(`Server listening on ${port}`))
 
PREVIOUS NEXT
Tagged: #POST #empty
ADD COMMENT
Topic
Name
1+2 =