API Design
The api can be simple, stateless, horizontally scalable.
It needs endpoints such as:
- POST url/<long-url>
- This endpoint will generate a short code, save it in the ID (as primary or indexed key) along with the long url
- GET url?shortUrl=shortUrl
- This endpoint is what the main page will use via JS at load time to redirect the user from the short url to the long url