URL shortner in go
- clone
git clone [email protected]:thebluespecs/short-it.git
- installing dependencies
[!note] building or running the server takes care of this in golang.
- Build, the server uses make as a build engine. This takes care of the dependencies of the project by itself.
make build
- Running the server
make run
- Stop the process. While a simple
CTRL + c
should kill the process. The supporting container in the background would need the below command to stop
make stop
[!note] assuming we are running on loopback adresses with port 8000
- shorten a URL
curl --location 'localhost:8000/shorten' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://github.com/"
}'
- get info about the shortened url
curl --location 'localhost:8000/:some_id/info'
- redirection
curl --location 'localhost:8000/:some_id'