diff --git a/Client b/Client new file mode 100755 index 0000000000000000000000000000000000000000..ce1f9c28bb8aa183639b005326d2b96f713a0e26 Binary files /dev/null and b/Client differ diff --git a/go.mod b/go.mod deleted file mode 100644 index e8b04e727acbfa33d1914da181bbc2d3b0c228c0..0000000000000000000000000000000000000000 --- a/go.mod +++ /dev/null @@ -1,3 +0,0 @@ -module git.gvk.idi.ntnu.no/johannta/Client - -go 1.12 diff --git a/main.go b/main.go new file mode 100644 index 0000000000000000000000000000000000000000..5eb5bfe09a9c7be38001a6096946d16de4a4feaa --- /dev/null +++ b/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "fmt" + "html" + "log" + "net/http" + "os" +) + +//Server that prints halli + +func helloHandler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path)) +} + +func main() { + port := os.Getenv("PORT") + port = "8080" + + if port == "" { + log.Fatal("$PORT must be set") + } + + http.HandleFunc("/", helloHandler) + + log.Fatal(http.ListenAndServe(":"+port, nil)) +} diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000000000000000000000000000000000000..3e4cfe47cfaaf052bdf86714777f584fafb5c3e7 --- /dev/null +++ b/main_test.go @@ -0,0 +1,5 @@ +package main + +func main() { + $END$ +} diff --git a/procfile b/procfile new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391