You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to rework server/server.js template to support async boot scripts.
boot(app, __dirname, function(err) {
if (err) throw err;
// start the server if `$ node server.js`
if (require.main === module) {
app.start();
});
In order to support the scenario when the app is loaded via require but not started, e.g. in loopback-sdk-angular-cli, we need to modify loopback-boot to emit an event when the boot process is finished, e.g. app.emit('ready').
We need to rework
server/server.jstemplate to support async boot scripts.In order to support the scenario when the app is loaded via
requirebut not started, e.g. in loopback-sdk-angular-cli, we need to modify loopback-boot to emit an event when the boot process is finished, e.g.app.emit('ready').Tasks
readyevent (or similar)server/server.jstemplate to deferapp.startuntilboot(app)is finishedslc loopback:exampleto use async boot script for generating models, see example/templates/server/boot/create-sample-data.js