ITADN

Applying `middleware.StaticWithConfig` to `echo.Group` always results in 404

#2923Openivan-avalos 创建于 2026-03-21
I
ivan-avaloscommented
I'm applying the `StaticWithConfig` middleware to a group and it always returns 404, am I doing anything wrong? It seems to work if I apply directly to `e` instead of to the group. ```go e.Pre(middleware.Rewrite(map[string]string{"/": "/app"})) app := e.Group("/app") app.Use(middleware.StaticWithConfig(middleware.StaticConfig{ IgnoreBase: true, HTML5: true, Root: "../client/out", Index: "index.html", })) auth := e.Group("/api") // ... ``` ``` $ ls -la ../client/out avalos@macmini server % ls -la ../client/out ... -rw-r--r-- 1 avalos staff 11914 Mar 21 23:22 index.html ... ``` Thanks in advance.
1 条评论