load port and host from config file
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
This commit is contained in:
parent
c6f6f07fdf
commit
297a430503
2 changed files with 8 additions and 9 deletions
|
@ -22,7 +22,7 @@ ump = false
|
|||
|
||||
[jobs.youtube_session]
|
||||
po_token_enabled = true
|
||||
frequency = "*/5 * * * *"
|
||||
frequency = "*/1 * * * *"
|
||||
|
||||
[youtube_session]
|
||||
oauth_enabled = false
|
||||
|
|
15
src/main.ts
15
src/main.ts
|
@ -115,23 +115,22 @@ app.use("*", async (c, next) => {
|
|||
|
||||
routes(app, konfigStore);
|
||||
const https = Deno.env.get("HTTPS");
|
||||
const port = konfigStore.get("server.port") as number;
|
||||
const host = konfigStore.get("server.host") as string;
|
||||
|
||||
|
||||
if (https == "TRUE" || https == "true") {
|
||||
const cert = Deno.readTextFileSync("/data/cert.pem");
|
||||
const key = Deno.readTextFileSync("/data/key.key");
|
||||
Deno.serve({
|
||||
port: Number(Deno.env.get("PORT")) ||
|
||||
konfigStore.get("server.port") as number,
|
||||
hostname: Deno.env.get("HOST") ||
|
||||
konfigStore.get("server.host") as string,
|
||||
port: port,
|
||||
hostname: host,
|
||||
cert: cert,
|
||||
key: key,
|
||||
}, app.fetch);
|
||||
} else {
|
||||
Deno.serve({
|
||||
port: Number(Deno.env.get("PORT")) ||
|
||||
konfigStore.get("server.port") as number,
|
||||
hostname: Deno.env.get("HOST") ||
|
||||
konfigStore.get("server.host") as string,
|
||||
port: port,
|
||||
hostname: host,
|
||||
}, app.fetch);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue