From 6961669b57d96a9b7e4e658f2094128a446309a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Snorre=20Magnus=20Dav=C3=B8en?= Date: Sun, 15 Oct 2023 15:50:14 +0200 Subject: [PATCH] fix: Resolve dashboard assets last MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When middleware for dashboard assets is on root path and before the route handlers it seems the did well known route does not work (404 errors). This is fixed by moving the middleware for the assets after other routes are set up. Signed-off-by: Snorre Magnus Davøen --- server/server.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/server.go b/server/server.go index c45831d..bf1a09e 100644 --- a/server/server.go +++ b/server/server.go @@ -50,14 +50,6 @@ func Server(config *ServerConfig) *fiber.App { return cors.New(corsConfig)(c) }) - // Serve the Solid dashboard - app.Use("/", filesystem.New(filesystem.Config{ - Browse: false, - Index: "index.html", - Root: http.FS(dist), - PathPrefix: "/dist", - })) - // Serve the assets // Middleware to track the latency of each request @@ -226,5 +218,13 @@ func Server(config *ServerConfig) *fiber.App { }) + // Serve the Solid dashboard + app.Use("/", filesystem.New(filesystem.Config{ + Browse: false, + Index: "index.html", + Root: http.FS(dist), + PathPrefix: "/dist", + })) + return app }