beego快速入门

beego的官方网址:https://beego.me

参考文档:https://beego.me/quickstart

1:安装

  您需要安装 Go 1.1+ 以确保所有功能的正常使用。

  需要已经设置GOPATH和GOROOT,不会设置可以参考我的另一篇文档

  你需要安装或者升级 Beego 和 Bee 的开发工具:

    go get -u github.com/astaxie/beego
    go get -u github.com/beego/bee

2:创建项目
  linux平台
    $ cd $GOPATH/src
    $ bee new blog
    $ cd blog
    $ bee run blog

  windows平台
    >cd %GOPATH%/src
    >bee new blog
    >cd blog
    >bee run blog
 或者直接./blog 

3:supervisor管理
  [program:goBlog]
  directory=/code/goDemo/src/blog/
  command=/code/goDemo/src/blog/blog
  stdout_logfile=/root/log/blog_$(date -I).log
  autostart=true
  autorestart=true
  startsecs=5
  priority=1
  stopasgroup=true
  killasgroup=true


4:配置nginx代理
  listen 80;
  server_name blog.xxx.com;

  location / {
    root html;
    index index.html index.htm;
    proxy_pass http://127.0.0.1:8080;
  }





原文地址:https://www.cnblogs.com/chy123/p/9418660.html