golang beego框架环境搭建过程
作者:Jeff的技术栈 时间:2024-02-13 03:29:39
环境搭建
下载安 * eego,bee
1.开启gomod设置代理
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn
2.安 * eego和bee
go get -u -v github.com/astaxie/beego
go get -u -v github.com/beego/bee
3.升级bee
bee update
4.zsh: command not found: bee
GOPATH/bin下的bee.exe 拷贝到 GOROOT/bin里面,也就是你的go语言环境变量的bin里面,然后运行 bee
5.bee相关命令
bee new name //创建项目
bee version //打印当前的Bee版本
bee migrate //运行数据库迁移
bee api name //创建一个BeegoAPI应用程序
bee run //项目编译,项目启动
bee pack //在项目目录下执行,将项目打包zip包
bee generate //该命令自动化生成代码
bee dockerize. // 生成dockerfile文件实现应用docer化
bee bale //将非go文件转换为go源文件
bee fix //通过使应用程序与更新版本的Beego兼容来修复应用程序
bee pro //源码生成器
bee update. //更新bee
6.项目启动
进入项目目录 执行 bee run 命令,在浏览器输入网址:127.0.0.1:8080,显示如下:7.beego项目结构分析
quickstart //项目名称
|-- conf //项目有关的配置文件夹
| |--app.conf
|-- controllers //主要的业务代码
| |--default.go
|-- models //存放的是数据库有关内容
|-- routers //存放路由文件
| |-- router.go
|-- static//存放静态资源
| |-- css
| |-- img
| |-- js
|-- tests //测试文件
| |-- default_test.go
|-- views //视图文件
|-- index.tpl
|-- main.go
来源:https://www.cnblogs.com/guyouyin123/p/14026275.html
标签:golang,beego,环境搭建
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Yolov5多边形标签和JSON数据格式转换
2023-11-06 17:31:24
![](https://img.aspxhome.com/file/2023/4/117944_0s.jpg)
表格梳理解析python内置时间模块看完就懂
2023-10-21 08:10:27
Web表单设计:表单结构
2011-04-22 12:32:00
不用加载Include文件也能生成选择列表吗?
2009-10-29 12:30:00
MacOS 下安装 MySQL8.0 登陆 MySQL的方法
2024-01-19 11:30:02
python远程连接MySQL数据库
2024-01-19 13:53:29
JavaScript实现点击按钮复制指定区域文本(推荐)
2023-08-22 17:36:30
go zero微服务实战性能优化极致秒杀
2023-06-17 03:45:30
![](https://img.aspxhome.com/file/2023/4/86304_0s.jpg)
python代码如何注释
2021-08-16 20:46:29
Jupyter Notebook添加代码自动补全功能的实现
2021-01-07 07:31:12
![](https://img.aspxhome.com/file/2023/5/86435_0s.png)
Jupyter notebook 远程配置及SSL加密教程
2021-06-24 07:15:06
![](https://img.aspxhome.com/file/2023/5/115175_0s.jpg)
Python连接数据库并批量插入包含日期记录的操作
2024-01-12 21:07:03
MySQL派生表联表查询实战过程
2024-01-18 14:18:28
![](https://img.aspxhome.com/file/2023/4/95624_0s.png)
matlab读取串口数据并显示曲线的实现示例
2022-12-17 15:56:17
在pycharm创建scrapy项目的实现步骤
2022-06-02 02:56:56
![](https://img.aspxhome.com/file/2023/0/66780_0s.png)
Python图像锐化与边缘检测之Sobel与Laplacian算子详解
2023-01-25 01:36:04
![](https://img.aspxhome.com/file/2023/1/95691_0s.png)
Python实现简单2048小游戏
2023-08-13 00:19:18
![](https://img.aspxhome.com/file/2023/3/71553_0s.jpg)
PHP+Ajax实现无刷新分页实例详解(附demo源码下载)
2024-06-07 15:50:03
![](https://img.aspxhome.com/file/2023/9/122469_0s.jpg)
Linux安装Python虚拟环境virtualenv的方法
2022-07-07 00:33:36
python GUI库图形界面开发之PyQt5信号与槽事件处理机制详细介绍与实例解析
2021-03-23 03:49:14
![](https://img.aspxhome.com/file/2023/4/85054_0s.png)