(资料图片)
新建文件,该文件为主启动程序,负责建立HTTP服务以响应客户端到
serveWebsocket
请求响应。
package mainimport ( "flag" "log" "net/http")var addr = ("addr", ":3000", "http service address")func serveHome(w , r *) { () if != "/" { (w, "Not found", ) return } if != { (w, "Method not allowed", ) return } (w, r, "public/")}
标签: