Chuanshuoge
Saturday 3 October 2020
golang 12 simple web app
package main
import (
"fmt"
"net/http"
)
func index_handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Whoa, Go is neat")
}
func main() {
http.HandleFunc("/", index_handler)
http.ListenAndServe(":8000", nil)
}
reference:
https://www.youtube.com/watch?v=-QmdZ7821wA
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment