https://repl.it/@JosiahSprankle/boilerplate-project-urlshortener#server.js

I believe I’ve arrived at a solution similar to the one described in the criteria, but it isn’t accepting the result. It can:
-POST requests to api/shorturl/new
-Send error messages for bad url
-Store the urls and successfully redirect using api/shorturl/num

Here is the code
Why isn’t it being accepted in the challenge

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:81.0) Gecko/20100101 Firefox/81.0.

Challenge: URL Shortener Microservice

Link to the challenge:

Edit: You posted a link, not code I’m editing my post.
To post a link in markdown you provide something like this;
[text users click](the link to your code)

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

You should edit the title of your post so it’s something informative.
Putting in a link doesn’t tell anyone what you need help with and a link in the title cannot be clicked.

Welcome to the forums.

I tried your form once I found it (I was expecting to use the boilerplate one). You can submit and get a response, but there is no code to store the url and its shortened version anywhere, despite you requiring mongodb and mongoose. Also, the redirection did not work either.

The point of this project is to store the shortened urls for future use, even between instances of the program running. Yours seems to partially work as long as the program does not exit. You’ll want to use some database (mongodb and mongoose for instance) to store the url and shortened version at the very minimum and then redirect to the original url when something GETs the shortened version. See the hints in the boilerplate…

/** this project needs a db !! **/
// mongoose.connect(process.env.DB_URI);
...
/** this project needs to parse POST bodies **/
// you should mount the body-parser here