23 lines
439 B
Go
23 lines
439 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"net/http"
|
|
)
|
|
|
|
func main() {
|
|
go pinger()
|
|
go cpuInfo.Run()
|
|
go ramInfo.Run()
|
|
|
|
log.Println("listening on :7123")
|
|
|
|
http.Handle("/ping", http.HandlerFunc(pingEP))
|
|
http.Handle("/cpu", http.HandlerFunc(cpuInfo.Render))
|
|
http.Handle("/ram", http.HandlerFunc(ramInfo.Render))
|
|
http.Handle("/favicon.ico", http.NotFoundHandler())
|
|
if err := http.ListenAndServe(":7123", nil); err != nil {
|
|
log.Fatalln(err)
|
|
}
|
|
}
|