mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-18 18:55:54 +08:00
20 lines
406 B
Go
20 lines
406 B
Go
package asynqmon_test
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
|
|
"github.com/hibiken/asynq"
|
|
"github.com/hibiken/asynqmon"
|
|
)
|
|
|
|
func ExampleHTTPHandler() {
|
|
h := asynqmon.New(asynqmon.Options{
|
|
RootPath: "/monitoring",
|
|
RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},
|
|
})
|
|
|
|
http.Handle(h.RootPath(), h)
|
|
log.Fatal(http.ListenAndServe(":8000", nil)) // visit localhost:8000/monitoring to see asynqmon homepage
|
|
}
|