When a script in `models/` or `boot/` exports a function which is not a loopback.Model constructor, the bootstrapper immediatelly calls this exported function wit the current `app` object. This is providing a dependency injection mechanism for boot scripts, so that they no longer need to know where to find the `app` object. Note: the dependency injection is optional. Existing code getting `app` reference via `require('../app')` will continue to work. |
||
---|---|---|
.. | ||
fixtures/simple-app | ||
helpers | ||
boot.test.js | ||
global-setup.js |