Microservice Shorturl - retrieving error

hi
here is the link: https://boilerplate-project-urlshortener.zia73.repl.co

Below test case is not getting through:

  • When you visit /api/shorturl/<short_url> , you will be redirected to the original URL.

Do I need to connect it to the database or it should be ok to push into an array and retrieve?

You need a persistent way of storing the data, otherwise you would lose it all if you had to restart the server. Since you should have already learned how to use Mongo by now, a Mongo database would definitely work. Another option would use a text file that you could read/write but it was not be as efficient as a database.

Thanks a lot. I will try with Mongodb.