我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Golang中的路由失败

So I created a simple static site using go.

https://play.golang.org/p/s3XOqLj2SM

When you hit the root directory, the index.html page loads just fine including all the assets.

If you try to navigate to one of the other pages, the html does not load. I get a 404 error.

What am I doing wrong?

Sorry for the mix up, there was a typo in the links within the html files. If anyone else has this issue, it wasn't with the go side of things. It was within the HTML files not linking to the correct routes.

近期文章

  • 结合了GO GIN-GONIC GORM和VALIDATOR.V2
  • 优化大型数组中的值比较-Go
  • 连接到TCP服务器的连接数不能超过140个吗?
  • 去找不到本地包
  • 使用GORM for Golang进行一对一关系映射
  • 自我自我?
  • 如何在虹膜中解析查询字符串
  • glCreateShader上的SegFault
  • 消除类型开关中的重复代码
  • 编码/ csv:我应该将Error()与WriteAll()一起使用吗?
  • Golang:如何将image.image转换为uint16
  • Gomobile绑定委托/回调行为
  • 在后台运行并收集数据的渠道
  • 从嵌套数组golang mongodb中删除元素
  • 使用Go-ping库时指定源IP地址
  • Go-如何使用gin接收ajax类型为DELETE的json数据
  • 扩展Rancher的Auth服务以使用其他(OAuth)提供程序
  • 在Go中封送XML时如何保留标签的名称空间url
  • 在嵌入式数组golang中检索范围时间mongodb之间的值
  • protobuf解组未知消息

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华