Skip to content

Instantly share code, notes, and snippets.

@henryboldi
Created May 13, 2014 21:19
Show Gist options
  • Save henryboldi/73eeebd7e76b540f2a31 to your computer and use it in GitHub Desktop.
Save henryboldi/73eeebd7e76b540f2a31 to your computer and use it in GitHub Desktop.
/**
* Bootstrap
*
* An asynchronous boostrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#documentation
*/
module.exports.bootstrap = function(cb) {
// It's very important to trigger this callack method when you are finished
// with the bootstrap! (otherwise your server will never lift, since it's waiting on the bootstrap)
User.update({}, {
online: false
},
function userUpdated(err, users) {
if (err) {
console.log(err);
} else {
// console.log(users);
}
cb();
}
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment