@@ -3,11 +3,13 @@ package web
33import (
44 "errors"
55 "fmt"
6+ "net/http"
67
7- "github.com/gofiber/adaptor/v2"
88 "github.com/gofiber/contrib/websocket"
99 "github.com/gofiber/fiber/v2"
10+ "github.com/gofiber/fiber/v2/middleware/adaptor"
1011 "github.com/gofiber/fiber/v2/middleware/cors"
12+ "github.com/gofiber/fiber/v2/middleware/filesystem"
1113 jwtware "github.com/gofiber/jwt/v3"
1214 "github.com/highcard-dev/daemon/cmd/server/web/middlewares"
1315
@@ -198,10 +200,16 @@ func (s *Server) SetAPI(app *fiber.App) *fiber.App {
198200 apiRoutes .Get ("/ports" , s .portHandler .GetPorts ).Name ("ports.list" )
199201
200202 publicUiRoutes .Get ("/public/index" , s .uiHandler .PublicIndex ).Name ("ui.public_index" )
201- publicUiRoutes .Static ("/public" , s .scrollPath + "/public" ).Name ("ui.public" )
203+ publicUiRoutes .Use ("/public" , filesystem .New (filesystem.Config {
204+ Root : http .Dir (s .scrollPath + "/public" ),
205+ Browse : false ,
206+ }))
202207
203208 privateUiRoutes .Get ("/private/index" , s .uiHandler .PrivateIndex ).Name ("ui.private_index" )
204- privateUiRoutes .Static ("/private" , s .scrollPath + "/private" ).Name ("ui.private" )
209+ privateUiRoutes .Use ("/private" , filesystem .New (filesystem.Config {
210+ Root : http .Dir (s .scrollPath + "/private" ),
211+ Browse : false ,
212+ }))
205213
206214 if s .annotationHandler != nil {
207215 app .Get ("/annotations" , s .annotationHandler .Annotations ).Name ("annotations.list" )
0 commit comments