File tree Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Expand file tree Collapse file tree 2 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -51,15 +51,16 @@ npm install
51
51
52
52
Start server:
53
53
``` sh
54
- # set DEBUG env variable to get debug logs
54
+ # Start server
55
+ npm start
56
+
57
+ # Selectively set DEBUG env var to get logs
55
58
DEBUG=express-mongoose-es6-rest-api:* npm start
56
- # OR
57
- # requires gulp to be installed globally
58
- npm i -g gulp
59
- gulp serve
60
59
```
60
+ Refer [ debug] ( https://www.npmjs.com/package/debug ) to know how to selectively turn on logs.
61
+
61
62
62
- Execute tests :
63
+ Tests :
63
64
``` sh
64
65
# Run tests written in ES6 along with code coverage
65
66
npm test
@@ -71,14 +72,19 @@ npm run test:watch
71
72
npm run test:check-coverage
72
73
```
73
74
74
- Other gulp tasks :
75
+ Lint :
75
76
``` sh
76
- # Wipe out dist and coverage directory
77
- gulp clean
78
-
79
77
# Lint code with ESLint
80
78
npm run lint
79
+
80
+ # Run lint on any file change
81
81
npm run lint:watch
82
+ ```
83
+
84
+ Other gulp tasks:
85
+ ``` sh
86
+ # Wipe out dist and coverage directory
87
+ gulp clean
82
88
83
89
# Default task: Wipes out dist and coverage directory. Compiles using babel.
84
90
gulp
88
94
89
95
``` sh
90
96
# compile to ES5
91
- 1. npm run build or gulp
97
+ 1. npm run build
92
98
93
99
# upload dist/ to your server
94
100
2. scp -rp dist/ user@dest:/path
Original file line number Diff line number Diff line change 1
- import Promise from 'bluebird' ;
2
1
import mongoose from 'mongoose' ;
3
2
import util from 'util' ;
4
3
import config from './config/env' ;
5
4
import app from './config/express' ;
6
5
7
6
const debug = require ( 'debug' ) ( 'express-mongoose-es6-rest-api:index' ) ;
8
7
8
+ // make bluebird default Promise
9
+ Promise = require ( 'bluebird' ) ; // eslint-disable-line no-global-assign
10
+
9
11
// plugin bluebird promise in mongoose
10
12
mongoose . Promise = Promise ;
11
13
You can’t perform that action at this time.
0 commit comments