File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ if (file.error) {
21
21
/** Current environment environment. "development", "test" or "production" */
22
22
const NODE_ENV = process . env . NODE_ENV || 'development' ;
23
23
24
+ /** Port to run the server on */
25
+ const PORT = process . env . PORT || 8080 ;
26
+
24
27
/**
25
28
* Certificate path required for local development, should not include trailing '/'.
26
29
* Located at top level of the repository in script folder
@@ -76,6 +79,7 @@ const MAINTENANCE_MODE = process.env.MAINTENANCE_MODE || '';
76
79
77
80
const processEnv = {
78
81
NODE_ENV ,
82
+ PORT ,
79
83
ADMIN_API ,
80
84
ADMIN_API_URL ,
81
85
BASE_URL ,
@@ -86,6 +90,7 @@ const processEnv = {
86
90
87
91
export {
88
92
NODE_ENV ,
93
+ PORT ,
89
94
BASE_URL ,
90
95
BASE_HREF ,
91
96
DISABLE_CONSOLE_ROUTE_PREFIX ,
Original file line number Diff line number Diff line change @@ -15,8 +15,6 @@ const fs = require('fs');
15
15
// const https = require('https');
16
16
const env = require ( '../../env' ) ;
17
17
18
- const PORT = 8080 ;
19
-
20
18
collectDefaultMetrics ( ) ;
21
19
22
20
const app = express ( ) ;
@@ -56,7 +54,7 @@ app.use(mainRouter);
56
54
57
55
const showEntryPointUrl = ( ) => {
58
56
console . log ( chalk . magenta ( `Express server ready!` ) ) ;
59
- const url = `https://${ env . LOCAL_DEV_HOST } :${ PORT } ${ env . BASE_URL } ` ;
57
+ const url = `https://${ env . LOCAL_DEV_HOST } :${ env . PORT } ${ env . BASE_URL } ` ;
60
58
61
59
// Open a new browser tab if in development
62
60
if ( env . NODE_ENV === 'development' ) {
@@ -84,9 +82,9 @@ if (env.ADMIN_API_USE_SSL === 'https') {
84
82
} ,
85
83
app ,
86
84
)
87
- . listen ( PORT , showEntryPointUrl ) ;
85
+ . listen ( env . PORT , showEntryPointUrl ) ;
88
86
} else {
89
- server = app . listen ( PORT , showEntryPointUrl ) ;
87
+ server = app . listen ( env . PORT , showEntryPointUrl ) ;
90
88
}
91
89
92
90
const shutdown : NodeJS . SignalsListener = ( signal ) => {
You can’t perform that action at this time.
0 commit comments