An URL shortener api implementation
The application provides two endpoints
/shorten- accepts json POST request as shown below. It responds with additionalshortUrlparameter that can be used to access original webpage.{ "LongUrl":"https://news.ycombinator.com/news" }/- accepts short url as GET request and redirects to original webpage.
Application provides another endpoint on port 3001. It allows to take backup of url store that are then loaded when the application starts.
/backupis used to take backups of the url store.
Note that with VSCode, you can use requests.http to test the application.