lean into examples
This commit is contained in:
13
examples/hello-web/hello-web.go
Normal file
13
examples/hello-web/hello-web.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func hello(res http.ResponseWriter, req *http.Request) {
|
||||
res.Header().Set("Content-Type", "text/plain")
|
||||
res.Write([]byte("Hello web\n"))
|
||||
}
|
||||
|
||||
func main() {
|
||||
http.HandleFunc("/", hello)
|
||||
http.ListenAndServe(":5000", nil)
|
||||
}
|
||||
Reference in New Issue
Block a user