diff --git a/main.go b/main.go index 0defc5d..a7f172d 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func main() { switch appRuntime { case "webserver": - runtime.StartWebserver() + runtime.StartWebserver(8081) default: log.Fatalln("Runtime is currently not implemented!") os.Exit(1) diff --git a/runtime/webserver.go b/runtime/webserver.go index 87eeaa3..423d32e 100644 --- a/runtime/webserver.go +++ b/runtime/webserver.go @@ -48,9 +48,9 @@ func getCharacter(w http.ResponseWriter, r *http.Request) { } // StartWebserver starts the webserver -func StartWebserver() { +func StartWebserver(port int) { myRouter := mux.NewRouter().StrictSlash(true) myRouter.HandleFunc("/health", healthCheck) myRouter.HandleFunc("/get/character/{user}/{char}", getCharacter) - log.Fatal(http.ListenAndServe(":8081", myRouter)) + log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), myRouter)) }