feat: support embed file system to serve files in rest (#4253)

This commit is contained in:
Kevin Wan
2024-07-17 16:21:08 +08:00
committed by GitHub
parent a00c956776
commit 5dd6f2a43a
4 changed files with 33 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ func TestMiddleware(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
middleware := Middleware(tt.path, tt.dir)
middleware := Middleware(tt.path, http.Dir(tt.dir))
nextHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusNotFound)
})