Skip to content

caoxiaolin/go-shorturl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Scrutinizer Code Quality codecov.io

shorturl

ShortURL Service Written by GoLang

get

go get github.com/caoxiaolin/go-shorturl

usage

http服务启动后 post一个url过去,返回短链接 请求短链接,返回原始的URL,链接不存在,则返回404

e.g.

curl -d "url=http://www.github.com" "http://127.0.0.1:4000"
http://127.0.0.1:4000/oM1F
curl "http://127.0.0.1:4000/oM1F"
http://www.github.com

请求不存在的短链时:

curl "http://127.0.0.1:4000/xx79y" -i
HTTP/1.1 404 Not Found
Date: Tue, 05 Jun 2018 10:18:12 GMT
Content-Length: 0

About

A ShortURL Service Written by GoLang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages