1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Cli: Added headless server command (Beta) (#1860)

* 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
This commit is contained in:
Laurent Cozic
2019-09-08 17:16:45 +01:00
committed by GitHub
parent 4488a1b95f
commit 3d6c932e1b
11 changed files with 333 additions and 177 deletions

View File

@@ -1,20 +1,22 @@
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;
state.port = startPort(env) + state.offset;
return state;
}
module.exports = randomClipperPort;
function startPort(env) {
const startPorts = {
prod: 41184,
dev: 27583,
};
return env === 'prod' ? startPorts.prod : startPorts.dev;
}
module.exports = { randomClipperPort, startPort };