Compare commits
2 Commits
056bfd9ffe
...
c72b0f54c7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c72b0f54c7 | ||
|
|
234d1d53f2 |
16
main.go
16
main.go
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@@ -191,10 +192,17 @@ func main() {
|
||||
syncedServer := NewPoolServer(syncedPool, name)
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/api/", http.StripPrefix("/api", syncedServer.Serve()))
|
||||
mux.HandleFunc("GET /add/remote/{host}", func(w http.ResponseWriter, r *http.Request) {
|
||||
syncedPool.AddRemote(r.PathValue("host"))
|
||||
})
|
||||
mux.HandleFunc("GET /save", app.HandleSave)
|
||||
// only for local
|
||||
// mux.HandleFunc("GET /add/remote/{host}", func(w http.ResponseWriter, r *http.Request) {
|
||||
// syncedPool.AddRemote(r.PathValue("host"))
|
||||
// })
|
||||
// mux.HandleFunc("GET /save", app.HandleSave)
|
||||
|
||||
mux.HandleFunc("/debug/pprof/", pprof.Index)
|
||||
mux.HandleFunc("/debug/pprof/cmdline", pprof.Cmdline)
|
||||
mux.HandleFunc("/debug/pprof/profile", pprof.Profile)
|
||||
mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
|
||||
mux.HandleFunc("/debug/pprof/trace", pprof.Trace)
|
||||
mux.Handle("/metrics", promhttp.Handler())
|
||||
|
||||
sigs := make(chan os.Signal, 1)
|
||||
|
||||
Reference in New Issue
Block a user