moetify
![Go Report Card](https://goreportcard.com/badge/github.com/kakugirai/moetify)
A minimal URL shortening service.
Build moetify locally
docker build -t moetify:latest .
Deploy on Kubernetes
Deploy redis and moetify.
kubectl apply -f k8s/redis-deployment.yml
kubectl apply -f k8s/moetify-deployment.yml
Create a redis service.
kubectl apply -f redis-service.yml
Create a moetify service of type LoadBalancer.
kubectl expose deployment moetify-app --name moetify-lb-service \
--type LoadBalancer --port 80 --target-port 8080
API
Create a tiny url.
curl -X POST http://moetify.vim.moe/api/shorten -d '{
"url": "http://example.com/",
"expiration_in_minutes": 5
}'
Get more tiny url information.
curl -X GET 'http://moetify.vim.moe/api/info?shortlink=B22ul6TZwiRl'
http://moetify.vim.moe/B33spMi94CO4 will be redirected to http://example.com/.