mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
3d6c932e1b
* Trying to implement headless server * Cli: Cleaned up and completed server command so that it is usable. Added warnings as it is advanced usage only at this point. * Restored welcome assets
23 lines
372 B
JavaScript
23 lines
372 B
JavaScript
function randomClipperPort(state, env) {
|
|
if (!state) {
|
|
state = { offset: 0 };
|
|
} else {
|
|
state.offset++;
|
|
}
|
|
|
|
state.port = startPort(env) + state.offset;
|
|
|
|
return state;
|
|
}
|
|
|
|
function startPort(env) {
|
|
const startPorts = {
|
|
prod: 41184,
|
|
dev: 27583,
|
|
};
|
|
|
|
return env === 'prod' ? startPorts.prod : startPorts.dev;
|
|
}
|
|
|
|
module.exports = { randomClipperPort, startPort };
|