wejsv2old-plugin
v0.2.3
Published
We.js v2 plugin engine
Downloads
6
Keywords
Readme
We.js plugin engine
Sails.js hook module loader to load modules from npm packages
Installation
1 - Download it inside your sails.js project with:
npm install we-plugin --save
2 - Create one hook with:
// api/hooks/plugins/index.js
module.exports = require('we-plugin').hook;
3 - update you app.js with:
Where has 'sails.lift(rc('sails'))' change to :
sails.lift(rc('sails',
require('we-plugin').getDefaultSailsConfig()
));
Plugin / sails npm module:
Plugin folder structure:
- api
- - models
- - - [model1].js
- - - [model2].js
- - controllers
- - - [controller1].js
- config
- - // sails.js configs
- lib
- - index.js
- - modelsAlter.js
- - init.js // use it for plug custom middlewares in sails.js hooks
Credits
Alberto Souza and contributors
License
MIT