statics use fs.FS
This commit is contained in:
parent
8bdf9e9b57
commit
3150ba80bc
@ -8,6 +8,7 @@ import (
|
||||
v1 "management/internal/erpserver/service/v1"
|
||||
mi "management/internal/pkg/middleware"
|
||||
"management/internal/pkg/session"
|
||||
static "management/web/statics"
|
||||
|
||||
"github.com/drhin/logger"
|
||||
"github.com/go-chi/chi/v5"
|
||||
@ -37,7 +38,8 @@ func NewHTTPServer(
|
||||
// r.Use(middleware.Logger)
|
||||
r.Use(middleware.Recoverer)
|
||||
|
||||
staticServer := http.FileServer(http.Dir("./web/statics/"))
|
||||
//staticServer := http.FileServer(http.Dir("./web/statics/"))
|
||||
staticServer := http.FileServer(http.FS(static.StaticFS))
|
||||
r.Handle("/statics/*", http.StripPrefix("/statics", staticServer))
|
||||
|
||||
uploadServer := http.FileServer(http.Dir("./public/"))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user