29 lines
643 B
JavaScript
29 lines
643 B
JavaScript
|
|
const config = {
|
||
|
|
port: parseInt(process.env.PORT, 10) || 8888,
|
||
|
|
|
||
|
|
baseDomain: process.env.BASE_DOMAIN || '',
|
||
|
|
|
||
|
|
projectPortStart: parseInt(process.env.PROJECT_PORT_START, 10) || 9000,
|
||
|
|
projectPortEnd: parseInt(process.env.PROJECT_PORT_END, 10) || 9100,
|
||
|
|
|
||
|
|
getProjectUrl(port) {
|
||
|
|
if (this.baseDomain) {
|
||
|
|
return `http://${this.baseDomain}:${port}`;
|
||
|
|
}
|
||
|
|
return `http://localhost:${port}`;
|
||
|
|
},
|
||
|
|
|
||
|
|
getBaseUrl() {
|
||
|
|
if (this.baseDomain) {
|
||
|
|
return `http://${this.baseDomain}`;
|
||
|
|
}
|
||
|
|
return `http://localhost:${this.port}`;
|
||
|
|
},
|
||
|
|
|
||
|
|
isProduction() {
|
||
|
|
return !!this.baseDomain;
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|
||
|
|
module.exports = config;
|