Skip to content

Instantly share code, notes, and snippets.

Created December 14, 2012 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4392b801b632023fc3fb to your computer and use it in GitHub Desktop.
Save anonymous/4392b801b632023fc3fb to your computer and use it in GitHub Desktop.
//./app.js
var mongoose = require('mongoose');
var db = mongoose.createConnection(cfg.mongo.uri, cfg.mongo.db);
//./models/user.js
var mongoose = require('mongoose')
, cfg = require('../config')
, bcrypt = require('bcrypt')
, Schema = mongoose.Schema;
var UserSchema = new Schema({
...
});
module.exports = mongoose.model('User', UserSchema);
//routes/index.js
var User = require('../models/user');
app still hangs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment