mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 00:38:33 +02:00
chore: change debug api addr to localhost:7777, fix makefile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ error_pages/
|
|||||||
!examples/error_pages/
|
!examples/error_pages/
|
||||||
profiles/
|
profiles/
|
||||||
data/
|
data/
|
||||||
|
debug/
|
||||||
|
|
||||||
logs/
|
logs/
|
||||||
log/
|
log/
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -50,6 +50,8 @@ export GODEBUG
|
|||||||
export GORACE
|
export GORACE
|
||||||
export BUILD_FLAGS
|
export BUILD_FLAGS
|
||||||
|
|
||||||
|
.PHONY: debug
|
||||||
|
|
||||||
test:
|
test:
|
||||||
GODOXY_TEST=1 go test ./internal/...
|
GODOXY_TEST=1 go test ./internal/...
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
func StartServer(cfg config.ConfigInstance) {
|
func StartServer(cfg config.ConfigInstance) {
|
||||||
srv := server.NewServer(server.Options{
|
srv := server.NewServer(server.Options{
|
||||||
Name: "debug",
|
Name: "debug",
|
||||||
HTTPAddr: ":8899",
|
HTTPAddr: "127.0.0.1:7777",
|
||||||
Handler: newHandler(cfg),
|
Handler: newHandler(cfg),
|
||||||
})
|
})
|
||||||
srv.Start(task.RootTask("debug_server", false))
|
srv.Start(task.RootTask("debug_server", false))
|
||||||
@@ -67,7 +67,7 @@ func iterMap[K comparable, V debuggable](m func() map[K]V) iter.Seq2[K, V] {
|
|||||||
func newHandler(cfg config.ConfigInstance) http.Handler {
|
func newHandler(cfg config.ConfigInstance) http.Handler {
|
||||||
mux := servemux.NewServeMux(cfg)
|
mux := servemux.NewServeMux(cfg)
|
||||||
mux.HandleFunc("GET", "/tasks", jsonHandler(task.AllTasks()))
|
mux.HandleFunc("GET", "/tasks", jsonHandler(task.AllTasks()))
|
||||||
mux.HandleFunc("GET", "/idlewatcher", jsonHandler(iterMap(idlewatcher.Watchers)))
|
mux.HandleFunc("GET", "/idlewatcher", jsonHandler(idlewatcher.Watchers()))
|
||||||
mux.HandleFunc("GET", "/agents", jsonHandler(agent.Agents.Iter))
|
mux.HandleFunc("GET", "/agents", jsonHandler(agent.Agents.Iter))
|
||||||
mux.HandleFunc("GET", "/proxmox", jsonHandler(proxmox.Clients.Iter))
|
mux.HandleFunc("GET", "/proxmox", jsonHandler(proxmox.Clients.Iter))
|
||||||
mux.HandleFunc("GET", "/docker", jsonHandler(iterMap(docker.Clients)))
|
mux.HandleFunc("GET", "/docker", jsonHandler(iterMap(docker.Clients)))
|
||||||
|
|||||||
Reference in New Issue
Block a user