snowdrift

1.0.4 • Public • Published

snowdrift

Alt text

This is a very simple url shortener.

Stores URLs in MongoDB.

Installation

npm install snowdrift -S

Setup & Usage

var snowdrift = require("snowdrift");
snowdrift.config(#mongodb_connection_url#, function(){
    console.log("ready to start shortening");
});

Shorten

store url and generate a unique key

snowdrift.shorten("http://apple.com", function(err, results){
    console.log(results);
});

Unshorten

retrieve url for unique key

snowdrift.unshorten("ortrw", function(err, results){
    console.log(results);
});
 

The Results

both methods return json containing key and url properties

 { 
    "key": "ortrw",
    "url": "http://apple.com" 
}

Readme

Keywords

none

Package Sidebar

Install

npm i snowdrift

Weekly Downloads

0

Version

1.0.4

License

GPL

Last publish

Collaborators

  • iksnae