app.js 423 B

1234567891011121314151617
  1. var express = require('express');
  2. var mongoose = require('../../../lib');
  3. var uri = 'mongodb://localhost/mongoose-shared-connection';
  4. global.db = mongoose.createConnection(uri);
  5. var routes = require('./routes');
  6. var app = express();
  7. app.get('/', routes.home);
  8. app.get('/insert', routes.insert);
  9. app.get('/name', routes.modelName);
  10. app.listen(8000, function() {
  11. console.log('listening on http://localhost:8000');
  12. });