aboutsummaryrefslogtreecommitdiff
path: root/content/appengine
diff options
context:
space:
mode:
Diffstat (limited to 'content/appengine')
-rw-r--r--content/appengine/main.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/content/appengine/main.go b/content/appengine/main.go
new file mode 100644
index 0000000..ac8feda
--- /dev/null
+++ b/content/appengine/main.go
@@ -0,0 +1,23 @@
+// This server can run on App Engine.
+package main
+
+import (
+ "fmt"
+ "log"
+ "net/http"
+ "os"
+)
+
+func main() {
+ port := os.Getenv("PORT")
+ if port == "" {
+ port = "8080"
+ }
+ http.HandleFunc("/", hello)
+
+ log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", port), nil))
+}
+
+func hello(w http.ResponseWriter, r *http.Request) {
+ w.Write([]byte("Hello, 世界"))
+}