1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 17:10:50 +00:00

增加入门文档和删除打开默认文档出错日志

This commit is contained in:
xiemengjun 2012-12-16 00:06:18 +08:00
parent 902acbb896
commit 7526b9df6e
2 changed files with 35 additions and 2 deletions

View File

@ -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

View File

@ -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"