url-shortener is a short URL service.
Using postgresql, redis, offer fast user experience.
Only Back-end
There are two ways to deploy this project:
- Compile deployment
- Container deployment
Environment requirement:
- Linux environment
- systemd(optional)
- root permission
- Go development environment
- Postgresql
- Redis
git clone https://github.com/okppop/url-shortener.git
cd url-shortener/
go mod tidy
go build .
cp config.yaml.example config.yaml
Then, use any editor edit "config.yaml".
Change host, username, database base your setting.
psql -h host -U username database < schema.sql
sudo mkdir -p /usr/local/url-shortener
sudo mv url-shortener config.yaml /usr/local/url-shortener/
sudo cp url-shortener.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl start url-shortener.service
Environment requirement:
- Linux environment
- Docker or other container manager
- Go development environment
- Postgresql
- Redis
git clone https://github.com/okppop/url-shortener.git
cd url-shortener/
Change host, username, database base your setting.
psql -h host -U username database < schema.sql
go mod tidy
CGO_ENABLED=0 go build .
cp config.yaml.example config.yaml
Then, use any editor edit "config.yaml".
docker build . -t url-shortener:1.0
docker run -d --network host --name url url-shortener:1.0