mirror of
https://github.com/astaxie/beego.git
synced 2024-12-22 17:10:50 +00:00
增加入门文档和删除打开默认文档出错日志
This commit is contained in:
parent
902acbb896
commit
7526b9df6e
35
README.md
35
README.md
@ -13,4 +13,37 @@ To install:
|
||||
|
||||
go install github.com/astaxie/beego
|
||||
|
||||
go version: go1 release
|
||||
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