web搭建路径链接问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/smilesundream/article/details/84101838

文件树如图:

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)

猜你喜欢

转载自blog.csdn.net/smilesundream/article/details/84101838
今日推荐