Skip to content

Instantly share code, notes, and snippets.

@ihucos

ihucos/server.go

Created Jun 5, 2020
Embed
What would you like to do?
package main
import (
"fmt"
"net/http"
)
func hello(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "hello world\n")
}
func main() {
http.HandleFunc("/hello", hello)
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment