Skip to content

Commit

Permalink
fix for sometimes stagnant mongoose connections
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhotchkiss committed Nov 2, 2011
1 parent b26fd49 commit 890b1fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -13,9 +13,7 @@ $ npm install short

```javascript
var mongoose = require("mongoose");
var short = require("short");

mongoose.connect("mongodb://localhost/short");
var short = require("short")("mongodb://localhost/short");

var URL = "http://nodejs.org/";

Expand Down Expand Up @@ -43,9 +41,7 @@ short.gen(URL, function(error, shortURL) {
```javascript
var http = require("http");
var mongoose = require("mongoose");
var short = require("short");

mongoose.connect("mongodb://localhost/short");
var short = require("short")("mongodb://localhost/short");;

var app = http.createServer(function(request, response) {
var hash = request.url.slice(1);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Edward Hotchkiss <e@ingk.com>",
"name": "short",
"description": "Generate, retieve short urls over mongoose/mongodb/express",
"version": "0.1.2",
"version": "0.1.3",
"repository": {
"type": "git",
"url": "git://github.com/edwardhotchkiss/short.git"
Expand Down
5 changes: 1 addition & 4 deletions test/index.test.js
Expand Up @@ -6,10 +6,7 @@ var should = require("should");
var mongoose = require("mongoose");

// short core
var short = require("../");

// connect to mongodb
mongoose.connect("mongodb://localhost/short");
var short = require("../")("mongodb://localhost/short");

vows.describe("General Module Tests").addBatch({
"when instantiating short" : {
Expand Down

0 comments on commit 890b1fa

Please sign in to comment.