mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-10-26 00:06:13 +08:00
Remove trailing slash from RootPath output string
This commit is contained in:
@@ -150,7 +150,8 @@ func main() {
|
|||||||
RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},
|
RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},
|
||||||
})
|
})
|
||||||
|
|
||||||
http.Handle(h.RootPath(), h)
|
// Note: We need the tailing slash when using net/http.ServeMux.
|
||||||
|
http.Handle(h.RootPath()+"/", h)
|
||||||
|
|
||||||
// Go to http://localhost:8080/monitoring to see asynqmon homepage.
|
// Go to http://localhost:8080/monitoring to see asynqmon homepage.
|
||||||
log.Fatal(http.ListenAndServe(":8080", nil))
|
log.Fatal(http.ListenAndServe(":8080", nil))
|
||||||
|
|||||||
@@ -78,8 +78,9 @@ func (h *HTTPHandler) Close() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RootPath returns the root URL path used for asynqmon application.
|
// RootPath returns the root URL path used for asynqmon application.
|
||||||
|
// Returned path string does not have the trailing slash.
|
||||||
func (h *HTTPHandler) RootPath() string {
|
func (h *HTTPHandler) RootPath() string {
|
||||||
return h.rootPath + "/"
|
return h.rootPath
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:embed ui/build/*
|
//go:embed ui/build/*
|
||||||
|
|||||||
Reference in New Issue
Block a user