diff options
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/express/connection-sharing/app.js')
-rw-r--r-- | common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/express/connection-sharing/app.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/express/connection-sharing/app.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/express/connection-sharing/app.js new file mode 100644 index 0000000..8fb2fee --- /dev/null +++ b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/examples/express/connection-sharing/app.js @@ -0,0 +1,17 @@ + +var express = require('express'); +var mongoose = require('../../../lib'); + +var uri = 'mongodb://localhost/mongoose-shared-connection'; +global.db = mongoose.createConnection(uri); + +var routes = require('./routes'); + +var app = express(); +app.get('/', routes.home); +app.get('/insert', routes.insert); +app.get('/name', routes.modelName); + +app.listen(8000, function() { + console.log('listening on http://localhost:8000'); +}); |