2018-05-26 12:18:54 +02:00
|
|
|
function randomClipperPort(state, env) {
|
2018-05-25 12:08:22 +02:00
|
|
|
if (!state) {
|
2018-06-18 19:54:48 +02:00
|
|
|
state = { offset: 0 };
|
2018-05-25 12:08:22 +02:00
|
|
|
} else {
|
2018-06-18 19:54:48 +02:00
|
|
|
state.offset++;
|
2018-05-25 12:08:22 +02:00
|
|
|
}
|
|
|
|
|
2019-09-08 18:16:45 +02:00
|
|
|
state.port = startPort(env) + state.offset;
|
2018-05-25 12:08:22 +02:00
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
2019-09-08 18:16:45 +02:00
|
|
|
function startPort(env) {
|
|
|
|
const startPorts = {
|
|
|
|
prod: 41184,
|
|
|
|
dev: 27583,
|
|
|
|
};
|
|
|
|
|
|
|
|
return env === 'prod' ? startPorts.prod : startPorts.dev;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = { randomClipperPort, startPort };
|