bee
bee copied to clipboard
bee run 访问404
mac OS 12.4 go version go1.18.3 darwin/amd64
bee api my_api // 创建项目
bee run // 运行项目, 我在goland里把代码运行起来, 之前的报错都处理了,正常运行后, 访问 http://localhost:8080, 404找不到页面
还有 go get github.com/beego/bee/v2 这个命令用不了, go install 也不行
复议
复议
可以提供一下代码吗?因为我每次本地搞我都不会遇到 404 的问题
C:\Users\administritor> bee version
2023/03/02 10:36:51.191 [W] init global config instance failed. If you donot use this, just ignore it. open conf/app.conf: The system cannot find the path specified.
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v2.0.2
├── GoVersion : go1.17.13
├── GOOS : windows
├── GOARCH : amd64
├── NumCPU : 4
├── GOPATH : D:\Go\GOPATH
├── GOROOT : C:\Program Files\Go
├── Compiler : gc
└── Published : 2022-06-12
C:\Users\administritor> bee api test
C:\Users\administritor> go mod tidy
C:\Users\administritor> bee run
然后访问 localhost:8080
就404了,访问默认提供的两个controller也404(确认注意到了v1命名空间前缀的问题)。
可能和bee、beego的版本有关系。
beego的版本(go.mod文件):
module test
go 1.16
require github.com/beego/beego/v2 v2.0.1
require github.com/smartystreets/goconvey v1.6.4
我始终无法复现,你试试升级到最新版本?
???神奇,几年了问题还在