Move stack creation when starting session

- If stack is not found return 400 status code
This commit is contained in:
Marcos Lilljedahl
2017-05-16 14:09:15 -03:00
parent 5dd56a2886
commit 31823109a5
4 changed files with 64 additions and 24 deletions

6
api.go
View File

@@ -73,11 +73,7 @@ func main() {
corsRouter.HandleFunc("/sessions/{sessionId}/instances/{instanceName}", handlers.DeleteInstance).Methods("DELETE")
corsRouter.HandleFunc("/sessions/{sessionId}/instances/{instanceName}/exec", handlers.Exec).Methods("POST")
h := func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "./www/index.html")
}
r.HandleFunc("/p/{sessionId}", h).Methods("GET")
r.HandleFunc("/p/{sessionId}", handlers.Home).Methods("GET")
r.PathPrefix("/assets").Handler(http.FileServer(http.Dir("./www")))
r.HandleFunc("/robots.txt", func(rw http.ResponseWriter, r *http.Request) {
http.ServeFile(rw, r, "www/robots.txt")