File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 11
11
*/
12
12
13
13
module . exports = {
14
- port : 9090 ,
14
+ port : process . env . MOCK_PORT || 9090 ,
15
15
env : process . env . NODE_ENV || 'development' // Current mode
16
16
}
Original file line number Diff line number Diff line change @@ -14,14 +14,12 @@ import Koa2 from 'koa'
14
14
import KoaBody from 'koa-body'
15
15
import KoaStatic from 'koa-static2'
16
16
import path from 'path'
17
- import config from '../config/config'
17
+ import { env , port } from '../config/config'
18
18
import ErrorRoutesCatch from './middleware/ErrorRoutesCatch'
19
19
import ErrorRoutes from './routes/error-routes'
20
20
import MainRoutes from './routes/main-routes'
21
21
22
22
const app = new Koa2 ( )
23
- const env = config . env
24
- const PORT = config . port
25
23
app
26
24
. use ( ( ctx , next ) => {
27
25
ctx . set ( 'Access-Control-Allow-Origin' , '*' )
@@ -58,6 +56,6 @@ if (env === 'development') {
58
56
} )
59
57
}
60
58
61
- app . listen ( PORT )
59
+ app . listen ( port )
62
60
63
61
export default app
You can’t perform that action at this time.
0 commit comments