url shortener backend using the node js, express js, mongo db ( do not use chat gpt or stack over flow )
Design a url shortener service that takes a valid url and then return a shortened url, redirection the user to the original url
Routes
- post / url - Generates a new short url and retturns the short url and returns the short url in the format example.com/ random-id.
- Get / :id - redirects the user to the original Url
- get/ url / analytics returns the clicks for the provided short id
- init the npm install the express and mongoose
- check the express if it is working fine ,
- create the schema for the database
- write the controllers
- // statements:
- generate a short unique id
- take the input from the users
- pass both of them in the db