UNPKG

@vph-garage/sails-interfuser

Version:

Automizing injection of your [custom Sails.JS] hook's MVC logics (models, controllers, helpers, services, config, policies, views, and assets) from the hook's directory [presuming default structure], or specified directories, into the end-product, Sails.J

35 lines (30 loc) 1.02 kB
/** * 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 */ module.exports.bootstrap = async function(done) { // 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) return done(); };