Tell us what’s happening:
Describe your issue in detail here.
What could be the problem because I have done all the best I can but am stuck?
Kindly guide where necessary.
Will be grateful.
You can POST a URL to /api/shorturl and get a JSON response with original_url and short_url properties. Here’s an example: { original_url : 'https://freeCodeCamp.org', short_url : 1}
you reference urlparser, but you have not defined what urlparser is anywhere in your code. This is going to be a problem once you resolve the POST route issue.
I can see you have created a new Replit where again you are not using the correct path for the POST. It literally has to be /api/shorturl you do not have a choice in the matter.
The test will hit that endpoint and the form is using api/shorturl for the action attribute.
@onyangaemmanuel25 Did you start this project in the last couple of days or did you originally start it a couple of years back? Can you provide the GitHub repo link you imported into Glitch?
I ask these questions as your boilerplate does not have the correct index.html or README.md` Did you remix this from another Glitch project? If so, which one?
If you want to use Glitch for the project, you should import the latest version of the the boilerplate from GitHub to make sure you have the correct base code. The GitHub shown in the project instructions is https://github.com/freeCodeCamp/boilerplate-project-urlshortener.
Did you pick the admin username when you made it? Not sure if that username might be reserved for something (don’t know). Maybe try creating a new user and use a different name.
I have maneuvered a lot but am finally reaching where am meant to be
Here is the link https://boilerplate-project-urlshortener.emmanuelonyanga.repl.co to the project am failing the second last test
Kindly check where the problem could be and advice me on what to do
Thanks in advance
Attached are the console readings
When I copy the shorturl generated to the browser it doesn’t direct me to the original url
What could be the problem.
If I fork your project and use my own DB it passes for me. I don’t ever see the err URLMODELFIND log. Can you please log out the actual error and not just that string?
I would try deleting the collection on Atlas and see if that fixes it.