Run the first GO web framework

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

The GO language is a lot of web frameworks, relatively speaking, Beego framework, easy to get started, complete documentation (Chinese), powerful, this article with Beego example.

Beego provides detailed development documentation: http://beego.me/docs/intro/

1. Installing the Beego and Bee tools

The installation of the Beego is typically in the form of a Go installation package:

 终端运行:go get github.com/astaxie/beego,安装在$GOPATH/src目录中

The Bee tool is a project created to assist in the rapid development of BEEGO projects, where you can quickly create projects, implement hot compilations, develop tests, and package releases from creation, development, and deployment with bee.

Terminal operation:go get github.com/beego/bee,安装完之后,bee可执行文件默认存放在$GOPATH/bin里面,所以需要把$GOPATH/bin添加到您的环境变量中,才可以进行下一步。

2. Create a new Web project

Performbee new myproject,但是注意该命令必须在 $GOPATH/src 下执行。最后会在 $GOPATH/src 相应目录下生成如下目录结构的项目:

MyProject├──Conf│└──App.Conf├──Controllers│└── Default.Go├──Main.Go├──Models├──Routers│ └── Router.├── static│    ├── Css│├── Img│   └── Js├── Tests│    └── Default_test.└── views └── Index.< Span class= "PLN" >tpl                

3. Run the project

Open Liteide, load the project directory, run:

Website has started, we login http://localhost:8080/to see the effect



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.