mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
20 lines
334 B
JavaScript
20 lines
334 B
JavaScript
function randomClipperPort(state, env) {
|
|
const startPorts = {
|
|
prod: 41184,
|
|
dev: 27583,
|
|
};
|
|
|
|
const startPort = env === 'prod' ? startPorts.prod : startPorts.dev;
|
|
|
|
if (!state) {
|
|
state = { offset: 0 };
|
|
} else {
|
|
state.offset++;
|
|
}
|
|
|
|
state.port = startPort + state.offset;
|
|
|
|
return state;
|
|
}
|
|
|
|
module.exports = randomClipperPort; |