A personal tinyurl service.

Now go, let the legend come back to life!
- Lightweight tinyurl service (in 100 lines).
- Semi-auto update with a remote config.
- Three types of routes:
- redirect to an url
- echo a string
- proxy tunnel
- Deploy to now.sh with one command.
-
cli
npm i -g now-go now-go -c path/to/config.json -
programaticly
import nowgo from 'now-go' nowgo('./config.json')
-
deploy to now.sh
now -e NOW_GO_CONFIG=http://example.com/config.json amio/now-go now alias https://now-go-ab78a901.now.sh/ short.example.comIf you don't have
nowyet,npm install -g now. Don't miss this awesome tool for realtime global deployments.
All configurations are optional:
{
"routes": {
// redirection (<value> is a url)
"home": "https://github.com/amio/now-go",
// proxy mode (<value> is a url prefixed with "PROXY >> ")
"ocelot.jpg": "PROXY >> https://example.com/path-to-ocelog.jpg",
// echo a string (<value> is a string)
"now-go": "Now go, let the legend come back to life!",
// special route for root path (<key> === "/")
"/": "Yet another tinyurl service.",
// special route for unmatched path: (<key> === "?")
"?": "What are you looking for?"
},
"port": 3030 // optional, 3000 by default
}This is the config for http://go.now.sh.
- Instead of
now-go -c config.json, start server with:or:now-go -c https://example.com/path-to-config.jsonNOW_GO_CONFIG=https://example.com/path-to-config.json now-go
NOTE: Visit root path(the sepcial route "/") will trigger an update task in background -- so called "semi-auto update" :)