mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
make embed.FS injectable
This commit is contained in:
10
static.go
10
static.go
@@ -6,15 +6,13 @@ import (
|
||||
"io/fs"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/ajatprabha/asynqmon/internal"
|
||||
)
|
||||
|
||||
func NewStaticContentHandler() http.Handler {
|
||||
func NewStaticContentHandler(contents embed.FS, staticDirPath, indexFileName string) http.Handler {
|
||||
return &staticContentHandler{
|
||||
contents: internal.StaticContents,
|
||||
staticDirPath: "assets",
|
||||
indexFileName: "index.html",
|
||||
contents: contents,
|
||||
staticDirPath: staticDirPath,
|
||||
indexFileName: indexFileName,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user