安装bee工具:
go get github.com/beego/bee/v2
安装beego框架:
go get -u github.com/beego/beego/v2
创建
root@ubuntu:~/beego# bee
Bee is a Fast and Flexible tool for managing your Beego Web Application.
You are using bee for beego v2.x. If you are working on beego v1.x, please downgrade version to bee v1.12.0
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 versions of Beego
pro Source code generator
dev Commands which used to help to develop beego and bee
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.
root@ubuntu:~/beego#
root@ubuntu:~/beego#
root@ubuntu:~/beego#bee new myproject
root@ubuntu:~/beego#cd myproject
root@ubuntu:~/beego/myproject# ll
total 92
drwxr-xr-x 2 root root 4096 Mar 7 12:56 conf/
drwxr-xr-x 2 root root 4096 Mar 7 12:56 controllers/
-rw-r--r-- 1 root root 167 Mar 7 12:57 go.mod
-rw-r--r-- 1 root root 49663 Mar 7 12:57 go.sum
-rwxr-xr-x 1 root root 57 Mar 7 12:56 lastupdate.tmp*
-rw-r--r-- 1 root root 125 Mar 7 12:56 main.go
drwxr-xr-x 2 root root 4096 Mar 7 12:56 models/
drwxr-xr-x 2 root root 4096 Mar 7 12:56 routers/
drwxr-xr-x 5 root root 4096 Mar 7 12:56 static/
drwxr-xr-x 2 root root 4096 Mar 7 12:56 tests/
drwxr-xr-x 2 root root 4096 Mar 7 12:56 views/
root@ubuntu:~/beego/myproject#
root@ubuntu:~/beego/myproject#go run main.go