文件树如图:

web搭建路径链接问题

html/index.html文件:

<img src="/static/logo.png">

direct:main.go文件create函数中

http.Redirect(w, r, "/query/", http.StatusFound)

路由设置:main.go文件中

 http.Handle("/static/", http.FileServer(http.Dir("./cloud/html")))
 http.HandleFunc("/", login)
 http.HandleFunc("/create/", create)
 http.HandleFunc("/query/", query)

 

相关文章: