Sign inSign up

doog/short-url

By doog

•Updated about 5 years ago

短地址服务

Image
0

203

doog/short-url repository overview

⁠短地址服务
 protoc --gofast_out=. **/*.proto
go run main.go
docker run --name=short-url \
	-d \
	--restart=always \
	-p 127.0.0.1:3000:3000/tcp \
	--env APP_PREFIX="http://example.com/" \
	--env APP_TOKEN="YOUR_TOKEN" \
	-v /data/short-url-store:/usr/src/app/short-url-store  \
	doog/short-url:latest
curl -X POST \
  http://127.0.0.1:3000/api/short-url \
  -H 'content-type: application/json' \
  -H 'x-token: YOUR_TOKEN' \
  -d '{
	"longUrl": "http://www.example.com",
	"maxAge": "1d"
}'
server {
    listen 80;
    server_name example.com;
    
    location / {
        proxy_pass http://127.0.0.1:3000;
    }
}

Tag summary

Content type

Image

Digest

Size

10.3 MB

Last updated

about 5 years ago

docker pull doog/short-url:1.0.2