Golang Web Application
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
Golang Web Application
GoLang Web App基本设置
1.导入库
导入fmt和net/http,http建立一个/和编写一个indexPage的函数,fmt编写一个写Hello world!
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", indexPage)
http.ListenAndServe(":8000", nil)
}
func indexPage(writer http.ResponseWriter, request