MCPcopy Create free account
hub / github.com/UnsignedInt8/LightSword / constructor

Method constructor

server/app.ts:15–34  ·  view source on GitHub ↗
(options?)

Source from the content-addressed store, hash-verified

13export class App {
14
15 constructor(options?) {
16 let defaultOptions = {
17 cipherAlgorithm: defaultCipherAlgorithm,
18 password: defaultPassword,
19 port: defaultServerPort,
20 timeout: 10,
21 expireTime: undefined,
22 disableSelfProtection: false,
23 speed: NaN
24 };
25
26 options = options || defaultOptions;
27 Object.getOwnPropertyNames(defaultOptions).forEach(n => options[n] = options[n] || defaultOptions[n]);
28
29 let server = new LsServer(options);
30 server.start();
31 server.once('close', () => App.Users.delete(options.port));
32
33 App.Users.set(options.port, server);
34 }
35
36 public static Users = new Map<number, LsServer>();
37

Callers

nothing calls this directly

Calls 4

startMethod · 0.95
onceMethod · 0.80
deleteMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected