Answer the question
In order to leave comments, you need to log in
Node.JS body-parser error, what should I do?
Hello Habr!
Why does such a fak-up appear when working with body-parser
const express = require('express');
const app = express();
var bodyParser = require('body-parser')
let urlcodedParser = app.use(bodyParser.urlencoded({ extended : false}));
app.get('/', (req,res) =>{
res.sendFile(__dirname + '/index.html');
})
app.post('/index', urlcodedParser, (req,res)=>{
console.log(req.body);
})
app.listen(3000, (req,res) =>{
console.log('ON')
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question