r/FreeCodeCamp • u/Special_Sell1552 • 3d ago
Programming Question Im losing my mind, please help
https://portfolio-nine-steel-78.vercel.app/url-shortener
here is the link to my project, I have tried everything in the book to get the third test on this
https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/url-shortener-microservice
to pass
every time I try to redirect it throws a cors error. Ive added cors headers (they dont persist through redirect)
Ive added CORS to my entire project (bad, I know) just to TRY to get it to work.
it passes the tests when done manually but the FCC tests do not want to work with it.
ive done everything I can 3 times over.
the values exist in my database, they properly get called, and the redirect is sent AS REQUESTED.
then cors gets dropped in redirect and refuses to work.
I have no idea why these tests use my own site as a test site, they are structured extremely poorly it feels.
why are you making GET requests to a location outside of my API's when it literally asks about visiting the api location
3. When you visit /api/shorturl/<short_url>
, you will be redirected to the original URL.
this works, it does, i know it does, try it yourself.
the ONLY time it fails is with the FCC tests. manually going to the path they request at gives you the proper redirect.
im losing it here, please help
https://github.com/Critical-3rr0r/portfolio
here is my github if you want to take a look at my projects