I am facing an issue where my POST request using Postman to my express app is timing out.
Here is the request:
https://i.sstatic.net/UfL07.png
And here is the app:
import express from 'express'
import bodyParser from 'body-parser'
import path from 'path'
const app = express()
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.post('/', (req,res) => {
console.log(req.body)
if (req.body.inviteCode === "12") {
res.json({value: "success"})
} else {
res.json({value: "fail"})
}
})
app.listen(process.env.PORT || 3000, () => {
console.log(`App listening on ${process.env.PORT || 3000}`)
})
console.log(req.body)
shows an empty object {}
Any thoughts on what could be causing this issue?