diff options
| -rw-r--r-- | examples/my_cool_server.ts | 2 | ||||
| -rw-r--r-- | laurali/server.ts | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/my_cool_server.ts b/examples/my_cool_server.ts index 793e01f..3cf3b6d 100644 --- a/examples/my_cool_server.ts +++ b/examples/my_cool_server.ts @@ -72,7 +72,7 @@ class MyCoolServer extends Server { override onListen() { MyCoolServer.logger.info( - `Listening on ${MyCoolServer.hostname}:${MyCoolServer.port}.`, + `Listening on ${this.hostname}:${this.port}.`, ); } } diff --git a/laurali/server.ts b/laurali/server.ts index b2a2446..bd2ff87 100644 --- a/laurali/server.ts +++ b/laurali/server.ts @@ -39,9 +39,9 @@ export abstract class Server { /** All registered hook functions of the `Server` */ static #hooks: Map<Hook, (ctx: Deno.TlsConn) => void> = new Map(); /** The port of the `Server` */ - static #port: number; + #port: number; /** The hostname of the `Server` */ - static #hostname: string; + #hostname: string; /** * @param certFile The path to the public key file of the `Server` @@ -56,8 +56,8 @@ export abstract class Server { const port = config?.port || 1965; const hostname = config?.hostname || "0.0.0.0"; - Server.#port = port; - Server.#hostname = hostname; + this.#port = port; + this.#hostname = hostname; this.#listener = Deno.listenTls({ port, @@ -78,13 +78,13 @@ export abstract class Server { } /** Get the `port` of the `Server` */ - static get port() { - return Server.#port; + get port() { + return this.#port; } /** Get the `hostname` of the `Server` */ - static get hostname() { - return Server.#hostname; + get hostname() { + return this.#hostname; } /** Called before a connection to a client has been responded to */ |