Skip to content

Commit

Permalink
fix: Resolve dashboard assets last
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
snorremd committed Oct 15, 2023
1 parent 4367222 commit 6961669
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 6961669

Please sign in to comment.