URL Shortener Microservice Test Passing Error

https://repl.it/talk/share/URL-Shortener-Microservice/82853

Hi everybody, above is a link to my url shortener microservice.

Essentially, the issue I’m running into is that it can’t pass the tests, however, I made a console.log function to see what URL’s it was sending, I also checked my mongoose database, when I go to the shorturl’s on my own, it works totally fine. I also can send in the “ftp:/…” link that the tester sends and it passes the invalid link json like it should. Is this a bug with the tester? Is there somewhere in my code that is causing this issue.

Also, I haven’t gotten around to re-formatting the main page from the FCC example because I am trying to get the app working first.

When I try to use your URL in project submission it’s giving me a CORS error.
I believe in your code app.use(cors) should be before you define your routes i.e app.get() and app.post

That fixed my issue, I took the time to read a little into cross-origin. I see the issue now, thank you!

For reference to anyone else, the project has been updated to put cross-origin statements in the beginning of the server.js file.

Thanks again mandeep147.