windows7+go语言+Beego框架安装使用

管理员 发布于 3年前   711

学习go语言,不管三七二十一先找个star高的框架体验一下


1.beego安装

接上一篇文章,git啥都要装这我就不说了,我go环境已经装好,1.15.5

go get github.com/astaxie/beego //git命令下载beego
go get github.com/beego/bee     //git命令下载bee工具


GO111MODULE=on //开启

env -w GO111MODULE=on


把GOPATH的bin目录添加到环境变量中

C:\Users\Administrator>bee
Bee is a Fast and Flexible tool for managing your Beego Web Application.
USAGE
    bee command [arguments]
AVAILABLE COMMANDS
    version     Prints the current Bee version
    migrate     Runs database migrations
    api         Creates a Beego API application
    bale        Transforms non-Go files to Go source files
    fix         Fixes your application by making it compatible with newer versio
ns of Beego
    pro         Source code generator
    dlv         Start a debugging session using Delve
    dockerize   Generates a Dockerfile for your Beego application
    generate    Source code generator
    hprose      Creates an RPC application based on Hprose and Beego frameworks
    new         Creates a Beego application
    pack        Compresses a Beego application into a single file
    rs          Run customized scripts
    run         Run the application by starting a local development server
    server      serving static content over HTTP on port
    update      Update Bee
Use bee help [command] for more information about a command.
ADDITIONAL HELP TOPICS
Use bee help [topic] for more information about that topic.

bee的一些介绍

new 命令:

new命令创建一个Web项目,我们在命令下执行bee new <项目名>就可以创建一个新的项目。

api命令:

上面的new命令是用来创建新Web项目,不过很多用户使用beego来开发API应用,所以api命令是用来创建API应用


2.执行命令创建项目 进入D:\goblog\src>目录

D:\goblog\src\gblog>dir
 驱动器 D 中的卷是 软件
 卷的序列号是 0008-8176
 D:\goblog\src\gblog 的目录
2020\12\07 周一  18:00    <DIR>          .
2020\12\07 周一  18:00    <DIR>          ..
2020\12\07 周一  17:31    <DIR>          conf
2020\12\07 周一  17:31    <DIR>          controllers
2020\12\07 周一  18:00        13,658,624 gblog.exe
2020\12\07 周一  17:32               195 go.mod
2020\12\07 周一  17:32             5,732 go.sum
2020\12\07 周一  17:31               103 main.go
2020\12\07 周一  17:31    <DIR>          models
2020\12\07 周一  17:31    <DIR>          routers
2020\12\07 周一  17:31    <DIR>          static
2020\12\07 周一  17:31    <DIR>          tests
2020\12\07 周一  17:31    <DIR>          views
               4 个文件     13,664,654 字节
               9 个目录 116,428,435,456 可用字节


3.运行 我这里直接用ide 按Ctrl+r运行  看效果咯

1.png

浏览器:

2.png

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

该博客于2020-12-7日,后端基于go语言的beego框架开发
前端页面使用Bootstrap可视化布局系统自动生成

是我仿的原来我的TP5框架写的博客,比较粗糙,底下是入口
侯体宗的博客

      订阅博客周刊

文章标签

友情链接

HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群
侯体宗的博客