-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
Closed
Labels
Description
I am using Express 4.16.1 version.
Express code:
`const express = require('express');
const app = express();
app.use(express.urlencoded({ extended: false }));
app.use(express.json());
app.post('/', (req, res) => {
console.log(req.body);// returns {}
res.send('this works');
});`
ReactJS code:
export function loginAuth(data) { const url='http://localhost:3001/'; return fetch(url, { method: 'POST', mode: 'no-cors', body: data, headers: { 'Content-Type': 'application/json' } }).then(res => { console.log(res); return res; }).catch(err => err); }