Tell us what’s happening:
Hello there ,
I’m doing this challenge of shorting URLs in the FCC challenges so I had to use body parser in order to get the url from the input field , I followed the documentation but I didn’t get any result from the req.body
The data is comming from a form POST (x-www-form-urlencoded). Use the urlencoded method instead, check the docs. You also want to get the url property on body and not save body to a url variable (so either destructuring the property or dotting on to it).
If you hover over it you can see it’s just a deprecation warning. You can use the built-in middleware instead (in Express v4.16.0 onwards), but both will work.
Your code works for me. When I post using the form I see the object in the console and the res.json on the page.