mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-09-22 06:46:34 +08:00
remove NewStaticContentHandlerFunc
This commit is contained in:
14
README.md
14
README.md
@@ -64,6 +64,8 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
|
||||
"github.com/hibiken/asynq"
|
||||
"github.com/hibiken/asynqmon"
|
||||
)
|
||||
@@ -74,16 +76,16 @@ var staticContents embed.FS
|
||||
func main() {
|
||||
h := asynqmon.New(asynqmon.Options{
|
||||
RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},
|
||||
StaticContentHandler: asynqmon.NewStaticContentHandler(
|
||||
staticContents,
|
||||
"ui-assets",
|
||||
"index.html",
|
||||
),
|
||||
})
|
||||
defer h.Close()
|
||||
|
||||
r := mux.NewRouter()
|
||||
r.PathPrefix("/api").Handler(h)
|
||||
// Add static content handler or other handlers
|
||||
// r.PathPrefix("/").Handler( /* &staticContentHandler{staticContents} */ )
|
||||
|
||||
srv := &http.Server{
|
||||
Handler: h,
|
||||
Handler: r,
|
||||
Addr: ":8080",
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user