2018-10-16 01:45:37 +00:00
|
|
|
/**
|
|
|
|
* Bootstrap
|
|
|
|
* (sails.config.bootstrap)
|
|
|
|
*
|
|
|
|
* An asynchronous bootstrap function that runs just before your Sails app gets lifted.
|
|
|
|
* > Need more flexibility? You can also do this by creating a hook.
|
|
|
|
*
|
|
|
|
* For more information on bootstrapping your app, check out:
|
|
|
|
* https://sailsjs.com/config/bootstrap
|
|
|
|
*/
|
|
|
|
|
2018-11-12 22:12:16 +00:00
|
|
|
module.exports.bootstrap = async function(done) {
|
|
|
|
|
2018-10-16 01:45:37 +00:00
|
|
|
// By convention, this is a good place to set up fake data during development.
|
|
|
|
//
|
|
|
|
// For example:
|
|
|
|
// ```
|
|
|
|
// // Set up fake development data (or if we already have some, avast)
|
|
|
|
// if (await User.count() > 0) {
|
|
|
|
// return done();
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// await User.createEach([
|
|
|
|
// { emailAddress: 'ry@example.com', fullName: 'Ryan Dahl', },
|
|
|
|
// { emailAddress: 'rachael@example.com', fullName: 'Rachael Shaw', },
|
|
|
|
// // etc.
|
|
|
|
// ]);
|
|
|
|
// ```
|
|
|
|
|
|
|
|
// Don't forget to trigger `done()` when this bootstrap function's logic is finished.
|
|
|
|
// (otherwise your server will never lift, since it's waiting on the bootstrap)
|
2018-11-12 22:12:16 +00:00
|
|
|
return done();
|
|
|
|
|
|
|
|
};
|