- Unix-based environment (Mac OSX, Linux)
- node.js version 6.0+ and npm version 3.0+, use nvm to manage multiple node.js versions
- Docker with the docker-compose command
- Clone repo with
git clone https://github.com/hydrotik/node-hapi-react-redux-sass-typescript-mongo-webpack-hmr-gulp --recursive
- Run
npm install
- Run
npm run dev
and visit http://localhost:8000/
Assuming you have created a git repo for your plugin, you'll use git submodules to develop it
- Run
git submodule add https://github.com/YOUR_PLUGIN_REPO plugins/YOUR_PLUGIN_REPO
- Run
git submodule update --init
to update all the plugins, including yours
Go to the src/server/Manifest.js file and adding something like the below will usually suffice:
{
"plugin": {
"register": "../../node_modules/YOUR_PLUGIN_REPO",
"select": ["web"],
"routes": {
"prefix": "/route_to_your_plugin"
},
"options": {
}
}
}
server.app.getMongo()
Returns a Promise that resolves with the MongoClient db object
server.app.getManifest()
Returns a JSON object containing the Manifest which contains global configuration
See plugins/dashboard-component/src/server/index.js for an example of plugin code and see the hapi.js documentation
contentedit https://github.com/dhsaks/contentedit