Skip to content

Commit

Permalink
bug fix #60
Browse files Browse the repository at this point in the history
  • Loading branch information
karldoenitz committed Nov 29, 2022
1 parent 66c3f84 commit 546ceb7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion TigoWeb/urlpattern.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func (urlPattern *UrlPattern) AppendRouterPattern(pattern Pattern, v interface {
urlPattern.router.HandleFunc(pattern.Url, middleware(v.Handle))
return
}
urlPattern.router.PathPrefix(pattern.Url).Handler(http.StripPrefix(pattern.Url, http.FileServer(http.Dir(filePath))))
fileRouter := urlPattern.router.PathPrefix(pattern.Url).Subrouter()
// TODO 此处加载gorilla的中间件
// fileRouter.Use()
fileRouter.PathPrefix("/").Handler(http.StripPrefix(pattern.Url, http.FileServer(http.Dir(filePath))))
}

// Init 初始化url映射,遍历UrlMapping,将handler与对应的URL依次挂载到http服务上
Expand Down

0 comments on commit 546ceb7

Please sign in to comment.