remove NewStaticContentHandlerFunc

This commit is contained in:
ajatprabha
2021-10-05 11:39:11 +05:30
committed by Ken Hibino
parent cb4ccea025
commit 0cbec9318f
6 changed files with 31 additions and 45 deletions

View File

@@ -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",
}