@@ -37,6 +37,10 @@ starterKit.init({
3737 database: {
3838 name: ' mainDb' // Database instance name within Hapi. /!\ Different from the actual database name
3939 syncForce: true , // Whether to reload the models each time the server restarts.
40+ modelPaths: [ // An array of path from where to load the Sequelize Models.
41+ ' lib/**/model.js' , // Default to ['lib/**/model.js', 'lib/**/models/*.js']
42+ ' lib/**/models/*.js'
43+ ],
4044 credentials: {
4145 dbName: ' myproject_db' // Database name
4246 user: ' root' , // User that will access the database
@@ -58,9 +62,26 @@ starterKit.start([
5862], loadFixtures).then (() => {
5963 // Do your thing !
6064});
65+
66+ // As init() returns an instance of itself, we can chain the calls:
67+ starterKit .init (config)
68+ .start (plugins, loadFixtures)
69+ .then (() => {
70+ // ...
71+ });
6172```
6273** For the Database config, please report to the Sequelize 3 documentation as this package is using Sequelize as well as Hapi-Sequelize.**
6374
75+ ## The StarterKit object
76+ ### Properties
77+ - starterKit.config: The loaded configuration.
78+ - starterKit.server: The Hapi server instanciated by the call to ` init() ` .
79+ - starterKit.sequelize: The Sequelize instance instanciated by the call to ` init() ` .
80+ - starterKit.initialized: A boolean specifying whether the object was initialized (i.e ` init() ` was called).
81+ ### Methods
82+ - init(config): returns an instance of the starterKit.
83+ - start(plugins, loadFixtures): returns a Promise resolved after the plugins registration, the model loading and optionaly the fixtures loading.
84+
6485## Documentation for .start()
6586The start function is used to:
6687- register Hapi plugins
0 commit comments