URL Shortener
A simple and efficient URL shortener service written in Go, using the Gin web framework, Redis for caching, and SQLite3 for persistent storage.
This project is inspired by Eddy WM's go-shortener-wm.
Prerequisites
- Go 1.21+
- Redis server with Bloom Filter module
Setup
- Install Redis.
- Clone the respository
git clone https://github.com/csBenClarkson/url-shortener.
cd url-shortener
- Get Go dependencies
go mod tidy
- Run the server with default settings and password
SHORTENER_SECRET=<YOUR_PASSWORD> go run .
Usage
You can configurate the Redis server address, sqlite3 database file location, host address, etc. through program arguments. Use go run . -h to see the help page.
You can also build the binary and run it.
go build .
SHORTENER_SECRET=<YOUR_PASSWORD> ./url-shortener [...argument]
License
This project use the MIT license. However, there are third-party modules used in this project. Check THIRD_PARTY_LICENSES for details.