2018-05-26 12:18:54 +02:00
|
|
|
function randomClipperPort(state, env) {
|
2018-06-18 19:54:48 +02:00
|
|
|
const startPorts = {
|
|
|
|
prod: 41184,
|
|
|
|
dev: 27583,
|
|
|
|
};
|
2018-05-26 12:18:54 +02:00
|
|
|
|
2018-06-18 19:54:48 +02:00
|
|
|
const startPort = env === 'prod' ? startPorts.prod : startPorts.dev;
|
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
|
|
|
}
|
|
|
|
|
2018-06-18 19:54:48 +02:00
|
|
|
state.port = startPort + state.offset;
|
2018-05-25 12:08:22 +02:00
|
|
|
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
|
2019-07-29 15:43:53 +02:00
|
|
|
module.exports = randomClipperPort;
|