Skip to content

Commit

Permalink
updated example to expose ShortModel and retrieve all Shortened URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhotchkiss authored and Edward Hotchkiss committed Dec 23, 2011
1 parent bd52867 commit 3baa245
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions examples/bkln.me/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ app.post('/api/*', function(request, response) {
});
});

/*!
Display all Short URL MongoDB Documents in JSON format
*/

app.get('/urls', function(request, response) {
ShortURL.find({}, function(error, results) {
if (error) {
console.error(error);
} else {
response.send(results);
}
});
});

/*!
Retrieve Short URLs & Redirect
*/
Expand Down
2 changes: 1 addition & 1 deletion examples/bkln.me/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Edward Hotchkiss <e@ingk.com>",
"name": "bkln.me",
"description": "Example usage of `npm install short`",
"version": "0.1.1-7",
"version": "0.1.1-8",
"repository": {
"type": "git",
"url": "git://github.com/edwardhotchkiss/short.git"
Expand Down

0 comments on commit 3baa245

Please sign in to comment.