From 67f997258ddc913bddebf0cb46288a63488ee736 Mon Sep 17 00:00:00 2001 From: Justyn Shull Date: Wed, 14 Aug 2024 13:27:55 -0700 Subject: [PATCH] Fallback to index page if unable to parse the indexPage config option (#1034) --- server/http_server.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/http_server.ts b/server/http_server.ts index 4dc1f883..ae8ed585 100644 --- a/server/http_server.ts +++ b/server/http_server.ts @@ -246,8 +246,12 @@ export class HttpServer { url.pathname === "/" ) { // Serve the UI (index.html) - const indexPage = - parsePageRef(this.spaceServer.config?.indexPage!).page; + let indexPage = "index"; + try { + indexPage = parsePageRef(this.spaceServer.config?.indexPage!).page; + } catch (e: any) { + console.error("Error parsing index page from config", e); + } return this.renderHtmlPage(this.spaceServer, indexPage, c); } try {