about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-11-07 13:41:19 +0100
committerEmile <hanemile@protonmail.com>2019-11-07 13:41:19 +0100
commit9dbb5ac642993499fb20cd21b064acbd8b36e410 (patch)
treed43d7534a6761878630c9e8b4327a0c8717cbab1 /src
parent6da09baa85ba96e72562fb3c1956711d167a4efb (diff)
api endpoint definitions
Diffstat (limited to 'src')
-rw-r--r--src/http.go9
1 files changed, 9 insertions, 0 deletions
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,