Fallback to index page if unable to parse the indexPage config option (#1034)

pull/1039/head
Justyn Shull 2024-08-14 13:27:55 -07:00 committed by GitHub
parent b7c56a8379
commit 67f997258d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -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 {