URL shortener project, help with POST request that is not working


Hi everyone! Hope you’re having a great Saturday :slight_smile:

I’m working through the freeCodeCamp API projects and I managed to write this URL shortener with the help of a bunch of tutorials, but I cannot get it to work. I’m obviously doing something horribly wrong :joy: but I’m still trying to wrap my head around GET and POST requests. Could someone please help me out?
This is what I’ve come up with so far:

Thanks so much in advance!! I really appreciate it :slight_smile:


Hey @yesvirginia,

Cool that you’re practicing and trying to write a URL shortener. Can you describe what exactly isn’t working when you’re POST-ing a new URL?

I seem to get an expected response:


Also, when I hit api/shorturl/845, it correctly redirects to Google.


Yeah, I fixed it a few hours after posting here and TOTALLY forgot to update here!!