Skip to content

Instantly share code, notes, and snippets.

@alexyoung
Created December 9, 2011 16:58
Show Gist options
  • Save alexyoung/1452374 to your computer and use it in GitHub Desktop.
Save alexyoung/1452374 to your computer and use it in GitHub Desktop.
example.txt
my-project/
Makefile (run tests)
index.js (require app.js and start it listening on a port)
package.json (include dependencies and devDependencies, package.json isn't just for publishing to npm)
lib/
app.js (Set up your Express app, assuming it's Express of course. You could do var User = require('models').User)
controllers/
users.js
models/
index.js (do exports.User = require('./user'); for each model)
user.js (maybe Mongoose schemas or whatever db you're using)
views/
users/
node_modules/
(installed modules go here)
Note: Mongoose allows you to create your model schemas without being connected to Mongoose first, so don't worry about the fact there isn't a 'connected' Mongoose object instance in the model files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment