瀏覽代碼

First commit

litpooh 3 年之前
當前提交
ecce762318
共有 1 個文件被更改,包括 15 次插入0 次删除
  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)
+}