From 9dbb5ac642993499fb20cd21b064acbd8b36e410 Mon Sep 17 00:00:00 2001 From: Emile Date: Thu, 7 Nov 2019 13:41:19 +0100 Subject: api endpoint definitions --- src/http.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/http.go b/src/http.go index 16361c6..e522cb1 100644 --- a/src/http.go +++ b/src/http.go @@ -35,6 +35,15 @@ func setupHTTPServer() http.Server { r.HandleFunc("/editSelect", editSelectGetHandler).Methods("GET") r.HandleFunc("/api/getChallenges", getChallenges).Methods("GET") + // register a new companion container + r.HandleFunc("/api/register/newCompanion", newCompanion).Methods("POST") + + // Handle the companion container + r.HandleFunc("/api/companion/getChallenges", getChallenges).Methods("GET") + r.HandleFunc("/api/companion/stopContainer", stopContainer).Methods("POST") + r.HandleFunc("/api/companion/startContainer", startContainer).Methods("POST") + r.HandleFunc("/api/companion/getRunningContainers", getRunningContainers).Methods("GET") + return http.Server{ Addr: fmt.Sprintf("0.0.0.0:%d", *port), Handler: r, -- cgit 1.4.1