Created
January 17, 2017 08:56
-
-
Save zrobit/f264de48012b84e628dac0c5500d4468 to your computer and use it in GitHub Desktop.
waterline orm load on express app server startup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = { | |
| dir: './models', | |
| adapters: { | |
| 'memory': require('sails-memory') | |
| }, | |
| connections: { | |
| default: { | |
| adapter: 'memory' | |
| } | |
| } | |
| }; | |
| var WaterlineLighter = require('waterline-lighter') | |
| WaterlineLighter(config) | |
| .then(function(waterline) { | |
| /* | |
| waterline.orm // waterline instance created by `new Waterline()` | |
| waterline.config // config passed to orm.initialize (with some extra opts) | |
| waterline.collections // collections loaded on the orm after inited | |
| waterline.connections // connections used by the orm after inited | |
| // The module also loads the connections and collections into the global object | |
| global.collections // same as waterline.collections | |
| global.connections // same as waterline.connections | |
| */ | |
| }) | |
| .then(function() { | |
| require('./app.js') | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment