mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 08:00:57 +00:00
增加入门文档和删除打开默认文档出错日志
This commit is contained in:
parent
902acbb896
commit
7526b9df6e
33
README.md
33
README.md
@ -14,3 +14,36 @@ To install:
|
||||
go install github.com/astaxie/beego
|
||||
|
||||
go version: go1 release
|
||||
|
||||
Quick Start
|
||||
============
|
||||
Here is the canonical "Hello, world" example app for beego:
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/astaxie/beego"
|
||||
)
|
||||
|
||||
type MainController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
func (this *MainController) Get() {
|
||||
this.Ct.WriteString("hello world")
|
||||
}
|
||||
|
||||
func main() {
|
||||
beego.BeeApp.RegisterController("/", &MainController{})
|
||||
beego.BeeApp.Run()
|
||||
}
|
||||
|
||||
default port:8080
|
||||
|
||||
http get http://localhost:8080
|
||||
HTTP/1.1 200 OK
|
||||
Content-Type: text/plain; charset=utf-8
|
||||
Date: Sat, 15 Dec 2012 16:03:00 GMT
|
||||
Transfer-Encoding: chunked
|
||||
|
||||
hello world
|
||||
|
Loading…
Reference in New Issue
Block a user