| // 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, 世界")) | |
| } |