Beego入门

首先下载golang1.26.3

bash 复制代码
go install github.com/beego/bee/v2@latest

安装成功

bash 复制代码
bee version

出现如下表示安装成功

bash 复制代码
2026/05/18 16:11:17.341 [D]  init global config instance failed. If you do not use this, just ignore it.  open conf/app.conf: The system cannot find the path specified.
______
| ___ \
| |_/ /  ___   ___
| ___ \ / _ \ / _ \
| |_/ /|  __/|  __/
\____/  \___| \___| v2.3.0

├── GoVersion : go1.26.3
├── GOOS      : windows
├── GOARCH    : amd64
├── NumCPU    : 12
├── GOPATH    : C:\Users\zd854\go
├── GOROOT    : D:\Program Files\Go
├── Compiler  : gc
└── Date      : Monday, 18 May 2026
bash 复制代码
bee new myblog
bash 复制代码
2026/05/18 16:13:47.909 [D]  init global config instance failed. If you do not use this, just ignore it.  open conf/app.conf: The system cannot find the path specified.
2026/05/18 16:13:47 INFO     ▶ 0001 Generate new project support go modules.
2026/05/18 16:13:47 INFO     ▶ 0002 Creating application...
        create   C:\Code\Go\myblog\go.mod
        create   C:\Code\Go\myblog\
        create   C:\Code\Go\myblog\conf\
        create   C:\Code\Go\myblog\controllers\
        create   C:\Code\Go\myblog\models\
        create   C:\Code\Go\myblog\routers\
        create   C:\Code\Go\myblog\tests\
        create   C:\Code\Go\myblog\static\
        create   C:\Code\Go\myblog\static\js\
        create   C:\Code\Go\myblog\static\css\
        create   C:\Code\Go\myblog\static\img\
        create   C:\Code\Go\myblog\views\
        create   C:\Code\Go\myblog\conf\app.conf
        create   C:\Code\Go\myblog\controllers\default.go
        create   C:\Code\Go\myblog\views\index.tpl
        create   C:\Code\Go\myblog\routers\router.go
        create   C:\Code\Go\myblog\tests\default_test.go
        create   C:\Code\Go\myblog\main.go
2026/05/18 16:13:48 SUCCESS  ▶ 0003 New application successfully created!

进入myblog文件夹

端口号可以在conf/app.conf中修改为自己喜爱的端口

bash 复制代码
go mod tidy
bash 复制代码
go run main.go

出现

bash 复制代码
2026/05/18 16:15:36.705 [I] [server.go:281]  http server Running on http://:8080

打开127.0.0.1:8080

恭喜你,入门beego成功了!

相关推荐
ThzxRHwXWOS3 个月前
三电平VSG并网系统(理论推导) 控制环路:虚拟同步发电机控制+电压电流双闭环控制 拓扑
beego
码界奇点4 个月前
基于Beego v2与Go语言的网站管理后台系统设计与实现
开发语言·golang·毕业设计·go语言·源代码管理·beego
咨询QQ276998855 个月前
半挂汽车列车横向稳定性控制:基于TruckSim与Simulink联合仿真
beego
咨询QQ:4877392786 个月前
风冷换热锂电池 Comsol6.0 模型:开启锂电热管理研究新视野
beego
小马过河R6 个月前
tRPC-GO 框架Helloworld实践初体验
开发语言·分布式·后端·架构·golang·gin·beego
扯淡的闲人9 个月前
Beego: Go Web Framework 详细指南
开发语言·golang·beego
猫头虎10 个月前
如何在 macOS 上使用 dnsmasq 搭建本地 DNS 缓存/转发
开发语言·macos·缓存·golang·beautifulsoup·beego·go1.19
qq_2787877710 个月前
Golang 调试技巧:在 Goland 中查看 Beego 控制器接收的前端字段参数
前端·golang·beego
猫头虎10 个月前
2025年02月11日 Go生态洞察:Go 1.24 发布亮点全面剖析
开发语言·后端·python·golang·go·beego·go1.19