mirror of
https://github.com/hibiken/asynqmon.git
synced 2025-01-18 18:55:54 +08:00
Added Fiber example
This commit is contained in:
parent
5eeeb9a35f
commit
4ac1794e3b
30
README.md
30
README.md
@ -280,6 +280,36 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
### [gofiber/fiber](https://github.com/gofiber/fiber)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/gofiber/adaptor/v2"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/hibiken/asynq"
|
||||
"github.com/hibiken/asynqmon"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := fiber.New(fiber.Config{})
|
||||
|
||||
app.All("/monitoring/tasks/*", adaptor.HTTPHandler(asynqmon.New(asynqmon.Options{
|
||||
RootPath: "/monitoring/tasks",
|
||||
RedisConnOpt: asynq.RedisClientOpt{
|
||||
Addr: ":6379",
|
||||
Password: "",
|
||||
DB: 0,
|
||||
},
|
||||
})))
|
||||
|
||||
log.Fatal(app.Listen(":8080"))
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2019-present [Ken Hibino](https://github.com/hibiken) and [Contributors](https://github.com/hibiken/asynqmon/graphs/contributors). `Asynqmon` is free and open-source software licensed under the [MIT License](https://github.com/hibiken/asynq/blob/master/LICENSE). Official logo was created by [Vic Shóstak](https://github.com/koddr) and distributed under [Creative Commons](https://creativecommons.org/publicdomain/zero/1.0/) license (CC0 1.0 Universal).
|
||||
|
Loading…
Reference in New Issue
Block a user