bee new MyFirstBee
bee run
发布:bee pack -be GOOS=linux, bee pack -be GOOS=windows
go env -w GO111MODULE=on
go mod init
以windows服务方式运行:
1.生成exe程序:bee run
2.通过nssm安装服务:
nssm install poms,
nssm start poms,
nssm stop poms,
nssm restart poms,
nssm remove poms
在window中发布到appache中
1.发布:bee pack -be GOOS=windows
2.
centos上发布beego程序
1.wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz
2.tar -xzvf go1.12.linux-amd64.tar.gz -C /usr/local/
3.修改/etc/profile
export GOROOT=/usr/local/go #设置为go安装的路径,有些安装包会自动设置默认的goroot
export GOPATH=$HOME/go #默认安装包的路径
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
4.source ./etc/profile
5.yum install git
6.go get github.com/beego/bee
7.go get github.com/astaxie/beego
8.bee version
9.chmod 777 /home/go
10.tar -xzvf file.tar.bz2