You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,11 +50,8 @@ Start server:
50
50
DEBUG=express-mongoose-es6-rest-api:* npm start
51
51
# OR
52
52
# requires gulp to be installed globally
53
-
npm install -g gulp
53
+
npm i -g gulp
54
54
gulp serve
55
-
56
-
# start in production environment
57
-
NODE_ENV=production npm start
58
55
```
59
56
60
57
Execute tests:
@@ -89,6 +86,25 @@ npm run commit
89
86
git commit -m "chore(ghooks): Add pre-commit and commit-msg ghook"
90
87
```
91
88
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
+
92
108
## Logging
93
109
94
110
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`
108
124
`npm test` also generates HTML code coverage report in `coverage/` directory. Open `lcov-report/index.html` to view it.
109
125

110
126
111
-
## Deploy to Heroku
112
-
113
-
Coming soon.
114
-
115
127
## A Boilerplate-only Option
116
128
117
129
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