about summary refs log tree commit diff
diff options
context:
space:
mode:
authorhanemile <hanemile@protonmail.com>2019-01-22 12:23:54 +0100
committerhanemile <hanemile@protonmail.com>2019-01-22 12:23:54 +0100
commite1ec6a26489b311ca5368fd227b527e6591882ee (patch)
tree8b34fb6959275c3e9de8bc1cd19f7dcc4308f3d3
parent29d78e9576d0d0331cf411fd027ab60aaf296b23 (diff)
updated the api description
-rw-r--r--Dockerfile5
-rw-r--r--main.go17
2 files changed, 14 insertions, 8 deletions
diff --git a/Dockerfile b/Dockerfile
index 95a29eb..f8db51c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,10 +2,11 @@ FROM golang:latest
 
 WORKDIR /home
 
-COPY main.go /home/main.go
+COPY *.go /home/
 
 RUN ["mkdir", "/exports"]
 RUN ["go", "get", "github.com/gorilla/mux"]
 RUN ["go", "get", "git.darknebu.la/GalaxySimulator/structs"]
+RUN ["ls", "-l"]
 
-ENTRYPOINT ["go", "run", "/home/main.go"]
+ENTRYPOINT ["go", "run", "."]
diff --git a/main.go b/main.go
index cdb21c8..680b8ed 100644
--- a/main.go
+++ b/main.go
@@ -20,12 +20,17 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
 	infostring := `Galaxy Simulator Database
 
 API:
-	/ GET
-	/new POST w float64
-	/insert/{treeindex} POST x float64, y float64, vx float64, vy float64, m float64
-	/starlist/{treeindex}
-	/printall GET
-	/metrics GET
+	- / ("GET")
+	- /new ("POST")
+	- /printall ("GET")
+	- /insert/{treeindex} ("POST")
+	- /starlist/{treeindex} ("GET")
+	- /dumptree/{treeindex} ("GET")
+	- /updatetotalmass/{treeindex} ("GET")
+	- /updatecenterofmass/{treeindex} ("GET")
+	- /metrics ("GET")
+	- /export/{treeindex} ("POST")
+	- /fastinsert/{filename} ("POST")
 `
 	_, _ = fmt.Fprintf(w, infostring)
 }