This is a URL shortener built using Go. The main objective was to learn how to use the Hexagonal Architecture. The service currently supports the following databases
Clone the project
git clone [email protected]:jwambugu/hexagonal-architecture-url-shortner.git
Go to the project directory
cd hexagonal-architecture-url-shortner
Set the environment variables (Redis)
export MS_REPOSITORY=redis
export REDIS_URL=redis-url-goes-here
Set the environment variables (MongoDB)
export MS_REPOSITORY=mongo
export MONGO_URL=mongo-url-goes-here
export MONGO_DB=redirects
Start the server
go run main.go
GET /{code}
Parameter | Type | Description |
---|---|---|
code |
string |
Required. |
POST /
Parameter | Type | Description |
---|---|---|
url |
string |
Required. URL to shorten |