| 1 |
package main |
| 2 |
|
| 3 |
import ( |
| 4 |
"net/http" |
| 5 |
) |
| 6 |
|
| 7 |
var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("hello world")) }) |
| 8 |
|
| 9 |
func main() { |
| 10 |
http.HandleFunc("/", myHandler) |
| 11 |
http.ListenAndServe(":8080", nil) |
| 12 |
} |