Skip to content

๐Ÿ‘Œ A tinyURL service powered by node.js, express.js and a reddis database.

Notifications You must be signed in to change notification settings

shahzeb1/nodejs-tinyURL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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, and Redis 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!

About

๐Ÿ‘Œ A tinyURL service powered by node.js, express.js and a reddis database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published