From 8972f44a15e23ffb263f8e0c55cf0e20a238b009 Mon Sep 17 00:00:00 2001 From: Quinn Ftw Date: Tue, 30 Dec 2025 15:24:40 -0800 Subject: [PATCH] fix(macos): serve index.html for root path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Swifter's shareFilesFromDirectory doesn't serve index.html for /, need explicit handler for root path. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../macos/Sources/Services/LocalWebServer.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/features/conversation-assistant/macos/Sources/Services/LocalWebServer.swift b/features/conversation-assistant/macos/Sources/Services/LocalWebServer.swift index e50766b62..4c566ccb6 100644 --- a/features/conversation-assistant/macos/Sources/Services/LocalWebServer.swift +++ b/features/conversation-assistant/macos/Sources/Services/LocalWebServer.swift @@ -31,7 +31,17 @@ class LocalWebServer { .appendingPathComponent("Resources/webapp") .path { NSLog("LocalWebServer: Serving static files from \(webappPath)") - server["/"] = shareFilesFromDirectory(webappPath) + + // Serve index.html for root path + let indexPath = webappPath + "/index.html" + server["/"] = { _ in + if let data = FileManager.default.contents(atPath: indexPath) { + return .ok(.data(data, contentType: "text/html")) + } + return .notFound + } + + // Serve other static files server["/:path"] = shareFilesFromDirectory(webappPath) } else { NSLog("LocalWebServer: Warning - webapp directory not found in bundle")