This commit is contained in:
2022-09-07 11:40:09 +07:00
parent 920f1d4f12
commit bab862a084
2 changed files with 18 additions and 12 deletions

View File

@@ -6,8 +6,10 @@ import (
"fmt"
)
var Version = "0.0.1"
func indexHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("<h1>Hello World!</h1>"))
w.Write([]byte("<h1>Hello World, im ver:"+Version+" !</h1>"))
}
func main() {
@@ -16,7 +18,7 @@ func main() {
port = "3000"
}
fmt.Print("\nim run in http://127.0.0.1:", port)
fmt.Print("\nVersion:", Version, ", Im run in http://127.0.0.1:", port)
mux := http.NewServeMux()
mux.HandleFunc("/", indexHandler)