shs

sails-hook-subapps

Sails hook for importing child Sails apps into a parent app

Showing:

Popularity

Downloads/wk

3

Maintenance

No Maintenance Data Available

Package

Dependencies

3

Size (min+gzip)

19.3KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Experimental

Offering zero support for this right now, use at your own risk and know that parts may change substantially. Requires Sails v0.11.x.

Holy smokes, it's the "plugin" we've all been waiting for.

In your sails.config.subapps:

module.exports.subapps = {
  blog: {
    connections: {
      main: 'localDiskDb'
    }
  }
};

In your app's subapps/blog/config/models.js:

module.exports.models = {

  connection: 'main',
  migrate: 'alter'

};

This will mount a subapp on /blog by default, so going to http://localhost:1337/blog/foo will load the /foo route from the Sails located in subapps/blog. Models in the blog app will use the localDiskDb connection from the main Sails app. Probably want to set that connection to use fileName: "disk.db" or something, otherwise each subapp will use its own database file.

More info to come.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial