Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[cleanup] remove examples/, single file already in README

  • Loading branch information...
commit 4e020b87445654d3d05f894386dab1b5b8b6e170 1 parent 20b5b11
@edwardhotchkiss authored
Showing with 7 additions and 50 deletions.
  1. +7 −14 README.md
  2. +0 −36 examples/basic.js
View
21 README.md
@@ -3,13 +3,11 @@
> NodeJS URL Shortener backed by MongooseJS w/ Examples
-Notes migrating to 1.0.0+
-===============
+## Notes migrating to 1.0.0+
NOTE: If you've used any version of Short before 1.0.0, please note the new API. This is a finalized API & with the previous API structure being incompatible with Short 1.0.0+
-Running Examples
-================
+## Running Examples
```bash
$ git clone git@github.com:edwardhotchkiss/short.git
@@ -17,8 +15,7 @@ $ cd short/examples/basic
$ node api.js
```
-Installation
-============
+## Installation
```bash
$ npm install short
@@ -26,8 +23,7 @@ $ npm install short
***
-Basic API Usage
-===============
+## Basic API Usage
Using short within your own project as an API interface
@@ -69,8 +65,7 @@ short.generate(URL, function(error, shortURL) {
```
-Complete Example with Express
-=============================
+## Complete Example with Express
**Please see** https://github.com/thinkroth/shortUrl
@@ -83,16 +78,14 @@ Pull Requests
* pull request
* **instant karma!**
-Run Tests (git clone)
-=====================
+## Run Tests (git clone)
``` bash
$ git clone git@github.com:edwardhotchkiss/short.git
$ cd short && npm test
```
-License (MIT)
-=============
+## License (MIT)
Copyright (c) 2011, Edward Hotchkiss.
View
36 examples/basic.js
@@ -1,36 +0,0 @@
-
-/*!
- Core Modules
- */
-
-var short = require('short')
- , URL = 'http://nodejs.org/';
-
-short.connect('mongodb://localhost/short');
-
-short.connection.on('error', function(error){
- throw new Error(error);
-});
-
-/*!
- Generate a Shortened URL
- Retrieve URL based on Generated Hash
- */
-
-short.generate(URL, function(error, shortURL) {
- if (error) {
- throw new Error(error);
- } else {
- short.retrieve(shortURL.hash, function(error, shortenedURLObject) {
- if (error) {
- throw new Error(error);
- } else {
- console.log('URL:', shortenedURLObject.URL);
- console.log('hash:', shortenedURLObject.hash);
- process.exit(0);
- }
- });
- }
-});
-
-/* EOF */
Please sign in to comment.
Something went wrong with that request. Please try again.