Skip to content

josephok/urlshorten

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

urlshorten (http://yige.info/)

A simple url shorten server, support HTTP method: GET and POST

Install

Install and run MongoDB(https://www.mongodb.org/) first, then

$ npm install

Run

$ NODE_ENV=production node app.js

Examples

POST:

$ curl -d "url=http://yige.info/" http://yige.info/; echo
{"code":200,"short":"yige.info/x21g1l13"}

$ curl -d "url=http://google.com/" http://yige.info/; echo
{"code":200,"short":"yige.info/qzfr1fr2"}

GET:

$ curl yige.info/x21g1l13; echo
{"code":200,"url":"http://yige.info/"}

$ curl yige.info/qzfr1fr2; echo
{"code":200,"url":"http://google.com/"}

About

A simple url shorten server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published