1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/lib/randomClipperPort.js

23 lines
372 B
JavaScript
Raw Normal View History

function randomClipperPort(state, env) {
2018-10-17 09:01:18 +02:00
if (!state) {
state = { offset: 0 };
} else {
state.offset++;
}
state.port = startPort(env) + state.offset;
2018-10-17 09:01:18 +02:00
return state;
}
function startPort(env) {
const startPorts = {
prod: 41184,
dev: 27583,
};
return env === 'prod' ? startPorts.prod : startPorts.dev;
}
module.exports = { randomClipperPort, startPort };