22 lines
576 B
Go
22 lines
576 B
Go
package routes
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.dubyatp.xyz/orphanage/client/facts"
|
|
"git.dubyatp.xyz/orphanage/client/httputil"
|
|
"git.dubyatp.xyz/orphanage/client/power"
|
|
"git.dubyatp.xyz/orphanage/client/testfunc"
|
|
)
|
|
|
|
func AddRoutes(
|
|
mux *http.ServeMux,
|
|
) {
|
|
mux.Handle("GET /", http.NotFoundHandler())
|
|
mux.Handle("GET /helloworld", httputil.HelloWorld(nil))
|
|
mux.Handle("GET /testjson", testfunc.HelloWorldJSON(nil))
|
|
mux.Handle("GET /facts", facts.GetFacts(nil))
|
|
mux.Handle("POST /power/reboot", power.Reboot(nil))
|
|
mux.Handle("POST /power/poweroff", power.PowerOff(nil))
|
|
}
|