1.1.0 • Published 9 years ago
kpipuller v1.1.0
KPI Runner
Key steps:
- Setup basic files
- $ npm install nodemon -g
- $ npm install babel babel-eslint eslint eslint-config-standard debug request -D
- run $ node index.js
Production setup
- $ npm install babel-runtime -S // for production
- setup compilation for production (see build script in package.json)
Source-map-support
- add to build script: babel --source-maps inline --optional runtime -d build ./modules
- install $ npm install source-map-support -S
- add "require('source-map-support')" to top of build/index.js
Implement Pull API
- $ npm install request -D
- Setup module pull.js
- Create config file
Run app in development mode
- $ DEBUG=INDEX2,rest nodemon index
Run app in production mode
- $ nodemon index
Sample Setup API Server
Setup
- Reference https://strongloop.com/strongblog/javascript-babel-future/
- optional: express, dotenv, body-parser, morgan, cors, helmet, jwt-simple, bcrypt
- https://github.com/cmwalsh/express_rethink/blob/master/app.js
Modules List
- express - The application server
- dotenv - To configure the application
- body-parser - To parse JSON
- morgan - To log activity
- cors - To allow requests from other domains
- helmet - For a bit of extra security
- jwt-simple - To issue access tokens
- moment - A date manipulation library
- bcrypt - To hash users passwords
- rethinkdb - database