package main
import (
"fmt"
"net/http"
)
func sayHello(w http.ResponseWriter, r *http.Request) {
_, _ = fmt.Fprintln(w, "Hello World")
}
func main() {
http.HandleFunc("/hello", sayHello)
err := http.ListenAndServe(":8080", nil)
if err != nil {
fmt.Println("Http Serve Not Start Failed:", err)
return
}
}
上一篇
RESTful
RESTful
2021-11-03
下一篇
nginx搭建文件服务
nginx搭建文件服务网站
2021-10-21