-
Notifications
You must be signed in to change notification settings - Fork 33
Deploy new Node.js app
We have developed this App using plain node.js coding style without using any framework and ORM libraries to make it easy to understand and for make ease to new developers.
For running new ready app below given packages be added in project. All these packages are available openly on web.
- express
- body-parser
- http
- mysql
- jade
- nconf
- aws-sdk-apis
We have a directory structure in which predefined files which should be added to every project to run the app properly are prefixed “wrio_”. These files contain necessary configuration for the project.
Use “gitignore” file to avoid un-necessary and configuration files pushing on server. Please add “config.json” file on your project and mention that file inside “gitignore” to prevent this file push on server.
- config.json File
This file contains data in JSON key-value pair. You can add any authentications or any secret that should kept inside server. Credentials must be encrypted.
Create New App Node.js App
1) Create or copy package.json.
- This file contains all repo detail, author detail and required packages name.
2) Create or copy wrio_app.js.
- This file contains default behaviour for the node app.
3) Create or copy config.json. This file contains all configuration for the app in json format.
4) Add config.json file in gitignore to avoid to push on the server.
- Make sure that config.json must not be pushed on the server.
5) Create or copy wrio_nconf.js.
- This file contains default behavior to read data from config.json
Note:
Please make sure that you have add “config.json” file into gitignore before pushing your code.