![image.png](https://static.studygolang.com/190609/b6085936ce6bbc1c6220327b1e98e0f1.png)
代码只有几行
main:
package main
import (
"1127/control"
"fmt"
"net/http"
)
func main() {
http.HandleFunc(`/`, control.Up)
fmt.Println("app is run on 80")
http.ListenAndServe(":80", nil)
}
control:
package control
import (
"io/ioutil"
"net/http"
)
func Up(w http.ResponseWriter, r *http.Request) {
buf, _ := ioutil.ReadFile(up.html)
w.Write(buf)
}
这是整个目录
![image.png](https://static.studygolang.com/190609/e19696aaa4e3d849a7cbfc0743b1b599.png)
好无奈,本机上就能运行,但是在那边机子上就不行
更多评论