Skip to content

Commit f5d1b6c

Browse files
committed
update config
1 parent 0b16f8a commit f5d1b6c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

mockServer/config/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
*/
1212

1313
module.exports = {
14-
port: 9090,
14+
port: process.env.MOCK_PORT || 9090,
1515
env: process.env.NODE_ENV || 'development' // Current mode
1616
}

mockServer/src/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import Koa2 from 'koa'
1414
import KoaBody from 'koa-body'
1515
import KoaStatic from 'koa-static2'
1616
import path from 'path'
17-
import config from '../config/config'
17+
import { env, port } from '../config/config'
1818
import ErrorRoutesCatch from './middleware/ErrorRoutesCatch'
1919
import ErrorRoutes from './routes/error-routes'
2020
import MainRoutes from './routes/main-routes'
2121

2222
const app = new Koa2()
23-
const env = config.env
24-
const PORT = config.port
2523
app
2624
.use((ctx, next) => {
2725
ctx.set('Access-Control-Allow-Origin', '*')
@@ -58,6 +56,6 @@ if (env === 'development') {
5856
})
5957
}
6058

61-
app.listen(PORT)
59+
app.listen(port)
6260

6361
export default app

0 commit comments

Comments
 (0)