app.use(bodyParser({ limit: 500*1024*1024, extended: true })); // или 1 (можно указать '500mb') например
app.use(bodyParser.json({ limit: 500*1024*1024, extended: true })); // или 2
app.use(bodyParser.urlencoded({ limit: 500*1024*1024, extended: true })); // или 3
client_max_body_size 5M;
/etc/nginx/nginx.conf
async function sendAndGetData(data) {
let response = await fetch('/', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
data: data
})
});
response = await response.json;
console.log(`${response.id} / ${response.data}`);
}
let counter = 0;
app.post('/', (req,res) => {
counter += 1;
res.send({
id: counter,
data: `Client data: ${req.body.data} / Query id: ${counter}`
})
})