Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shahzeb1/nodejs-tinyURL
👌 A tinyURL service powered by node.js, express.js and a reddis database.
https://github.com/shahzeb1/nodejs-tinyURL
Last synced: about 5 hours ago
JSON representation
👌 A tinyURL service powered by node.js, express.js and a reddis database.
- Host: GitHub
- URL: https://github.com/shahzeb1/nodejs-tinyURL
- Owner: shahzeb1
- Created: 2013-01-26T23:29:34.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-09T02:25:11.000Z (almost 8 years ago)
- Last Synced: 2024-04-14T08:04:30.923Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 526 KB
- Stars: 15
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NodeJS TinyURL Service
## Run your own URL shrinking service such as *bit.ly* or *goo.gl*.
### Powered by Node.js, Express.js, and Reddis.### Install:
- `$ git clone git://github.com/shahzeb1/nodejs-tinyURL.git`
- `$ cd nodejs-tinyURL`
- Make sure you have [Node.js](http://nodejs.org/), and [Redis](http://redis.io/download) installed.
- Run the `$ redis-server` command in a terminal window
- Finally, run the application via `$ node app.js` in another terminal window
- Visit `http://127.0.0.1:3000` to view the running application### API:
- `/tiny/[website.com]` — Returns json for a tinyed ID.
- `/x/[id]` — Redirects to tinyed website.
- `/stats/[id]` — Returns json of visits and the full URL.### Example:
- `$ curl http://127.0.0.1:3000/tiny/google.com`> {"url":"google.com","id":"giMgC"}
- `$ curl http://127.0.0.1:3000/stats/giMgC`
> {"id":"giMgC","views":"1","url":"google.com"}
Note: Inorder to use URL's with slashes use `encodeURIComponent(url)` and do not submit URL's with `http://` or `https://`
Enjoy!