litpooh 3 vuotta sitten
commit
ecce762318
1 muutettua tiedostoa jossa 15 lisäystä ja 0 poistoa
  1. 15 0
      server.go

+ 15 - 0
server.go

@@ -0,0 +1,15 @@
+package main
+
+import (
+	"fmt"
+	"net/http"
+)
+
+func index_handler(w http.ResponseWriter, r *http.Request) {
+	fmt.Fprintf(w, "Hello World!")
+}
+
+func main() {
+	http.HandleFunc("/", index_handler)
+	http.ListenAndServe(":8000", nil)
+}