parent
49612a9881
commit
d9a4c3a2e7
@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
http.ListenAndServe("localhost:4000", nil)
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Hello struct{}
|
||||
|
||||
func (h Hello) ServeHTTP(
|
||||
w http.ResponseWriter,
|
||||
r *http.Request) {
|
||||
fmt.Fprint(w, "Hello!\n")
|
||||
}
|
||||
|
||||
func main() {
|
||||
var h Hello
|
||||
http.ListenAndServe("localhost:4000", h)
|
||||
}
|
Loading…
Reference in new issue