- Go 1.23+
- PostgreSQL
- Docker
-
Clone the repository
git clone git@github.com:allash/shortly.git cd shortly -
Install dependencies
go mod download
-
Configure .env file
DB_CONNECTION_STRING={YOUR_DB_CONNECTION_STRING} -
Run postgres
cd infra docker-compose up -d -
Run application
go run ./cmd/api # if you already have installed Air then you can just run air
- GET /health
- GET /v1/{shortUrl}
- POST /v1/url/shorten
{
"value": "http://localhost:4000"
}