How do I pass this challenge? And please explain this challenge

Tell us what’s happening:
I am unable to pass this assignment. I am also not sure about what is the challenge. Please explain.

Your code so far

var express = require('express');
var bodyParser = require('body-parser')
var app = express();

app.use((req, res, next) => {
 bodyParser.urlencoded({extended: false});
 next();
})

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36.

Challenge: Use body-parser to Parse POST Requests

Link to the challenge:

Can you post a link to your Glitch project please.

Yeah https://glitch.com/edit/#!/ved08-fcc-assignments

I don’t see the code you posted in the Glitch code. You did not require body-parser in nor use it.

But I used it…ohh…maybe the project was not saved. That is why when I reloaded , the code was not there

Yeah…I have added it now. pls chk

Have a look at the ExpressJS docs. Look at the app.use example given
http://expressjs.com/en/resources/middleware/body-parser.html#examples

1 Like