Skip to content

Commit 7e4a4c4

Browse files
committed
docs(readme): Update deployment steps in readme
1 parent 176f0ce commit 7e4a4c4

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,8 @@ Start server:
5050
DEBUG=express-mongoose-es6-rest-api:* npm start
5151
# OR
5252
# requires gulp to be installed globally
53-
npm install -g gulp
53+
npm i -g gulp
5454
gulp serve
55-
56-
# start in production environment
57-
NODE_ENV=production npm start
5855
```
5956

6057
Execute tests:
@@ -89,6 +86,25 @@ npm run commit
8986
git commit -m "chore(ghooks): Add pre-commit and commit-msg ghook"
9087
```
9188

89+
##### Deployment
90+
91+
```sh
92+
# compile to ES5
93+
1. npm build or gulp
94+
95+
# upload dist/ to your server
96+
2. scp -rp dist/ user@dest:/path
97+
98+
# install production dependencies only
99+
3. npm i --production
100+
101+
# Use any process manager to start your services
102+
4. pm2 start index.js
103+
```
104+
105+
In production you need to make sure your server is always up so you should ideally use any of the process manager recommended [here](http://expressjs.com/en/advanced/pm.html).
106+
We recommend [pm2](http://pm2.keymetrics.io/) as it has several useful features like it can be configured to auto-start your services if system is rebooted.
107+
92108
## Logging
93109

94110
Universal logging library [winston](https://www.npmjs.com/package/winston) is used for logging. It has support for multiple transports. A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at different levels. For example, one may want error logs to be stored in a persistent remote location (like a database), but all logs output to the console or a local file. We just log to the console for simplicity, you can configure more transports as per your requirement.
@@ -108,10 +124,6 @@ Get code coverage summary on executing `npm test`
108124
`npm test` also generates HTML code coverage report in `coverage/` directory. Open `lcov-report/index.html` to view it.
109125
![Code coverage HTML report](https://cloud.githubusercontent.com/assets/4172932/12625331/571a48fe-c559-11e5-8aa0-f9aacfb8c1cb.jpg)
110126

111-
## Deploy to Heroku
112-
113-
Coming soon.
114-
115127
## A Boilerplate-only Option
116128

117129
If you would prefer not to use any of our tooling, delete the following files from the project: `package.json`, `gulpfile.babel.js`, `.eslintrc` and `.travis.yml`. You can now safely use the boilerplate with an alternative build-system or no build-system at all if you choose.

0 commit comments

Comments
 (0)