Skip to content

walirt/ShortLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShortLink

Short link generation service by golang

Install

go build .
If you do not enable go modules, run export GO111MODULE=on, then run go build .
If you are in China, you can use a proxy download package, run export GOPROXY=https://goproxy.cn

Usage

./ShortLink

API

  • POST /api/shorten
  • GET /api/info?shortlink=shortlink
  • GET /:shortlink return 302 code

Note

Use redis as the storage backend by default
If you want to replace other storage backends (e.g. mysql), you can implement the method of the Storage interface, similar to redis
There are some default environment variables

  • APP_REDIS_ADDR (default "localhost:6379")
  • APP_REDIS_PASSWD (default "")
  • APP_REDIS_DB (default "0")

Thank

Learn from Jacky_1024

License

About

Short link generation service by golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages