Skip to content

Instantly share code, notes, and snippets.

@artcommacode
Created February 22, 2013 11:17
Show Gist options
  • Save artcommacode/5012761 to your computer and use it in GitHub Desktop.
Save artcommacode/5012761 to your computer and use it in GitHub Desktop.
// user model
module.exports = function (user) {
// new user with 'user'
this.save = function() {
// save 'user'
};
};
module.exports.get = function (id) {
// query users by id
};
/************************************/
// user controller
var User = require('../models/users');
module.exports.index = function (req, res, next) {
var user = new User('test');
user.save();
};
module.exports.get = function (req, res, next) {
User.get(req.params.uid);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment