文件树如图:

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)

 

相关文章:

  • 2022-12-23
  • 2021-11-27
  • 2021-09-25
  • 2021-06-26
  • 2021-07-10
  • 2021-08-16
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2021-05-28
  • 2022-12-23
  • 2021-05-09
  • 2021-12-31
  • 2021-10-30
  • 2021-08-17
  • 2021-09-01
相关资源
相似解决方案