From 1ff29ac2af9c63bc0fffbb8cb02d9d39cb7ec218 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 21 Aug 2023 14:08:45 +0200 Subject: [PATCH] Don't make SB server exit immediately... --- cmd/server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/server.ts b/cmd/server.ts index 751b732..78bab34 100644 --- a/cmd/server.ts +++ b/cmd/server.ts @@ -13,6 +13,7 @@ import { SpacePrimitives } from "../common/spaces/space_primitives.ts"; import { S3SpacePrimitives } from "../server/spaces/s3_space_primitives.ts"; import { Authenticator } from "../server/auth.ts"; import { JSONKVStore } from "../plugos/lib/kv_store.json_file.ts"; +import { sleep } from "../common/async_util.ts"; export async function serveCommand( options: any, @@ -104,5 +105,9 @@ To allow outside connections, pass -L 0.0.0.0 as a flag, and put a TLS terminato certFile: options.cert, maxFileSizeMB: +maxFileSizeMB, }); - return httpServer.start(); + await httpServer.start(); + // Wait in an infinite loop (to keep the HTTP server running, only cancelable via Ctrl+C or other signal) + while (true) { + sleep(1000); + } }