Skip to content

Instantly share code, notes, and snippets.

@Jerry0420
Created September 1, 2020 07:12
Show Gist options
  • Save Jerry0420/3f176daf57cbe0efe0e0e691d56c53f8 to your computer and use it in GitHub Desktop.
Save Jerry0420/3f176daf57cbe0efe0e0e691d56c53f8 to your computer and use it in GitHub Desktop.
server.go
package main
import (
"io"
"net/http"
)
func sayhello(res http.ResponseWriter, req *http.Request) {
io.WriteString(res, "hello world")
}
func main() {
http.HandleFunc("/sayhello", sayhello)
http.ListenAndServe(":8081", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment