Files
tecamino-proccessSupervisor/main.go
Adrian Zürcher b9efeb670d
Some checks failed
Build Process Supervisor / build (push) Failing after 1s
first running version
2025-08-05 12:01:59 +02:00

32 lines
743 B
Go

package main
import (
"flag"
"fmt"
"log"
"net/http"
"processSupervisor/handlers"
)
func main() {
port := flag.Uint("port", 9400, "listenig port")
flag.Parse()
htop, err := handlers.NewHTopHandler()
if err != nil {
panic(err)
}
fs := http.FileServer(http.Dir("static"))
http.Handle("/static/", http.StripPrefix("/static/", fs))
http.HandleFunc("/taskmanager/htop", htop.UpdateHTop)
http.HandleFunc("/", handlers.UpdateMainPage)
http.HandleFunc("/taskmanager/kill", handlers.KillHandler)
http.HandleFunc("/taskmanager/usage", handlers.UsageHandler)
log.Printf("Listening on http://localhost:%d/taskmanager/htop\n", *port)
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), nil))
}