My solution for the DevGym's URL Shortener challenge.
In this challenge you must create a server to shorten URL and redirect short URLs to their original link.
HTTP Method | Endpoint | Description |
---|---|---|
POST |
/ |
Takes the URL and returns a unique code |
GET |
/:code |
Uses the code to return the original URL |
Note that code
is unique 6-chars string
. The same original URL should
generate different codes
.
Solution based on filhodanuvem's standard go api and Alex Xu's URL shortener suggested architecture.
To run the project on your machine.
make up
Now you should be able to create a short url and get redirected to the target url.
Read docs/http
files for more details.
To run all the tests:
make test