From 7526b9df6e9647144739e340ae7b21609cadd6b7 Mon Sep 17 00:00:00 2001 From: xiemengjun Date: Sun, 16 Dec 2012 00:06:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A5=E9=97=A8=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E5=92=8C=E5=88=A0=E9=99=A4=E6=89=93=E5=BC=80=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=96=87=E6=A1=A3=E5=87=BA=E9=94=99=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 35 ++++++++++++++++++++++++++++++++++- beego.go | 2 +- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 02c78a4b..d2fcb25f 100644 --- a/README.md +++ b/README.md @@ -13,4 +13,37 @@ To install: go install github.com/astaxie/beego -go version: go1 release \ No newline at end of file +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 diff --git a/beego.go b/beego.go index 6bb603d8..c92c750f 100644 --- a/beego.go +++ b/beego.go @@ -28,7 +28,7 @@ func init() { var err error AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf")) if err != nil { - Trace("open Config err:", err) + //Trace("open Config err:", err) HttpAddr = "" HttpPort = 8080 AppName = "beego"