super-project
Version:
Base framework for Super Project.
17 lines (13 loc) • 377 B
JavaScript
module.exports = (port, env = process.env.WEBPACK_BUILD_ENV) => {
const {
SERVER_PORT,
} = process.env
if (typeof port === 'object') {
if (typeof port[env] !== 'undefined')
return port[env]
return SERVER_PORT
}
if (typeof port !== 'undefined' && typeof port !== 'boolean')
return port
return SERVER_PORT
}