A brief description of the project, what it does, and its key features.
- ✅ API to Create new short url
- ✅ API to Redirect to full url
.
├── cmd/ # Entry points for the application (webserver)
├── internal/ # Private application logic (service, repository layer)
├── config/ # Configuration files (generic variable)
├── migrations/ # Database migrations
├── tests/ # Unit tests
├── Dockerfile # Docker configuration
├── Makefile # Build automation
└── README.md # Project documentation
https://github.com/viaannn/short-url-api.git
cd short-url-api
go mod tidy
Copy the example environment file and update it as needed:
cp .env.example .env
go run cmd/webserver/main.go
Or using Makefile
:
make run
Environment variables required:
PORT=8080
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=secret
DB_NAME=mydb
go test ./test
go test -cover ./test
docker build -t short-url-api .
docker run -p 8080:8080 --env-file .env short-url-api
docker-compose up -d
See .github/workflows/deploy.yml
for CI/CD automation.
This project is licensed under the MIT License.
🌟 Don't forget to give this project a star if you find it useful! 🌟