Url shortner project question

can you pleas tell me where i’m supposed to save the long url so i can access it when the get request comes , i’ve tried saving it in a file and use fileSystem to read it late , it worked but the test didn’t pass , i also tried using an object with diffrent key values for each request in case the test was not calling the last saved value but that didn’t work either.

Web application data is usually stored in database. See the MongoDB/Mongoose section of the back end coursework that precedes this project.

i see , i alredy finished taht course , i’ll try doing that , thanks.

edit : how can i do that in replit ? do you have any idea ?, when i click on PostgreSQL it says that i should buy a 10gb storage space.

As @jeremy.a.gray says, a section of this Backend course teaches you how to set up a free account and connection to MongoDB. If you’ve followed the whole course up to this point, you should have already done this, and can use it for ALL of the Backend projects. This all works perfectly well within replit and the course walks you through this step-by-step.

Here’s a link to the first part of the MongDB section:

I would stick to what is taught in the curriculum. So MongoDB and Mongoose, using the free tier on MongoDB Atlas. Just like it is done in the MongoDB and Mongoose challenges.

If you use a different database (even a different ORM) you can get into issues with how the id used looks (id vs _id) and then you have to transform the response to look like what you would be returning from Mongo/Mongoose because that is what the tests expect. I did one of the projects using Prisma and it was a little painful to have to transform the ids.

1 Like

thank you guys , it seems that somehow i only remembered the last course about databases and totaly forgot about the one in this course :person_facepalming: , i’ll go through it one more time .
thanks again :v:.