URL-Shortner
URL-Shortner in Go
Setup Steps
-
Clone the repo
-
Set the environment variable for mongodb_url
export MONGO_URL="mongodb_url"
-
Create a mongodb database by name url_shortner
-
Build go binary and run
-
Access the endpoint http://localhost:8000/encode and add payload:
{ "url": "http://<url>" }
-
To decode the url hit the endpoint http://localhost:8000/decode and add payload
{ "url":"<short_url>" }