beego官网https://beego.me/,如何安装与配置,首先查看官网提示。
按照提示,在shell中下载安装beego
go get github.com/astaxie/beego
安装bee工具
go get -u github.com/beego/bee
结果报错
sszxrmc:~ sszxr$ go get -u github.com/beego/bee
# github.com/beego/bee
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
sszxrmc:~ sszxr$
最终只能直接下载
sszxrmc:~ sszxr$ git clone https://github.com/beego/bee.git
Cloning into 'bee'...
remote: Enumerating objects: 405, done.
remote: Counting objects: 100% (405/405), done.
remote: Compressing objects: 100% (329/329), done.
remote: Total 4153 (delta 82), reused 329 (delta 64), pack-reused 3748
Receiving objects: 100% (4153/4153), 3.39 MiB | 246.00 KiB/s, done.
Resolving deltas: 100% (2073/2073), done.
sszxrmc:~ sszxr$
把下载的文件移动到go/src/github.com/beego
下面
然后在go/src目录下用bee命令创建一个项目
bee new hello
项目名称为hello
sszxrmc:src sszxr$ bee new hello
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.10.0
2018/11/09 17:50:41 INFO ▶ 0001 Creating application...
create /Users/sszxr/go/src/hello/
create /Users/sszxr/go/src/hello/conf/
create /Users/sszxr/go/src/hello/controllers/
create /Users/sszxr/go/src/hello/models/
create /Users/sszxr/go/src/hello/routers/
create /Users/sszxr/go/src/hello/tests/
create /Users/sszxr/go/src/hello/static/
create /Users/sszxr/go/src/hello/static/js/
create /Users/sszxr/go/src/hello/static/css/
create /Users/sszxr/go/src/hello/static/img/
create /Users/sszxr/go/src/hello/views/
create /Users/sszxr/go/src/hello/conf/app.conf
create /Users/sszxr/go/src/hello/controllers/default.go
create /Users/sszxr/go/src/hello/views/index.tpl
create /Users/sszxr/go/src/hello/routers/router.go
create /Users/sszxr/go/src/hello/tests/default_test.go
create /Users/sszxr/go/src/hello/main.go
2018/11/09 17:50:41 SUCCESS ▶ 0002 New application successfully created!
sszxrmc:src sszxr$
进入hello项目,执行命令bee run
sszxrmc:hello sszxr$ bee run
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.10.0
2018/11/09 17:59:42 INFO ▶ 0001 Using 'hello' as 'appname'
2018/11/09 17:59:42 INFO ▶ 0002 Initializing watcher...
hello/controllers
hello/routers
hello
2018/11/09 17:59:44 SUCCESS ▶ 0003 Built Successfully!
2018/11/09 17:59:44 INFO ▶ 0004 Restarting 'hello'...
2018/11/09 17:59:44 SUCCESS ▶ 0005 './hello' is running...
2018/11/09 17:59:44.662 [I] [asm_amd64.s:1333] http server Running on http://:8080
<