beego / bee

Bee is a tool for helping develop with beego app framework.
Apache License 2.0
1.44k stars 921 forks source link

bee run 访问404 #834

Open feng-wzf opened 2 years ago

feng-wzf commented 2 years ago

mac OS 12.4 go version go1.18.3 darwin/amd64

bee api my_api // 创建项目 bee run // 运行项目, 我在goland里把代码运行起来, 之前的报错都处理了,正常运行后, 访问 http://localhost:8080, 404找不到页面

image

image

还有 go get github.com/beego/bee/v2 这个命令用不了, go install 也不行

qizidog commented 1 year ago

复议

flycash commented 1 year ago

复议

可以提供一下代码吗?因为我每次本地搞我都不会遇到 404 的问题

qizidog commented 1 year ago
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
flycash commented 1 year ago

我始终无法复现,你试试升级到最新版本?

jonenet commented 10 months ago

???神奇,几年了问题还在