Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-url-shortener
Spawn up a simple webserver to act as a URL shortener
https://github.com/bahamas10/node-url-shortener
Last synced: about 2 months ago
JSON representation
Spawn up a simple webserver to act as a URL shortener
- Host: GitHub
- URL: https://github.com/bahamas10/node-url-shortener
- Owner: bahamas10
- Created: 2012-06-06T02:36:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-05-16T06:21:33.000Z (over 9 years ago)
- Last Synced: 2024-10-28T01:16:02.495Z (about 2 months ago)
- Language: JavaScript
- Size: 187 KB
- Stars: 6
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
url-shortener
=============Spawn up a simple webserver to act as a URL shortener
Usage
-----### Terminal 1
$ url-shortener
[2013-01-11T23:29:43.579Z] server listening on http://localhost:8090
{ github: 'https://github.com', paste: 'http://pastebin.com' }
[2013-01-11T23:29:56.600Z] 127.0.0.1 GET 200 / (2ms)
[2013-01-11T23:29:59.214Z] 127.0.0.1 GET 301 /paste (1ms)### Terminal 2
$ curl -s localhost:8090 | json
{
"paste": "http://www.pastebin.com",
"github": "https://github.com"
}
$ curl -I localhost:8090/paste
HTTP/1.1 301 Moved Permanently
Location: http://www.pastebin.com
Connection: keep-aliveConfig
------pass the config file name as the first argument
### config.json
``` json
{
"host": "localhost",
"port": 8090,
"gid": null,
"uid": null,
"urls": {
"paste": "http://www.pastebin.com",
"github": "https://github.com"
}
}
```Install
-------npm install -g url-shortener
License
-------MIT Licensed