An URL shortener api implementation
The application provides two endpoints
/shorten
- accepts json POST request as shown below. It responds with additionalshortUrl
parameter 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.
/backup
is used to take backups of the url store.
Note that with VSCode, you can use requests.http
to test the application.