mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 13:10:54 +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 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
|
||||||
|
2
beego.go
2
beego.go
@ -28,7 +28,7 @@ func init() {
|
|||||||
var err error
|
var err error
|
||||||
AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf"))
|
AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Trace("open Config err:", err)
|
//Trace("open Config err:", err)
|
||||||
HttpAddr = ""
|
HttpAddr = ""
|
||||||
HttpPort = 8080
|
HttpPort = 8080
|
||||||
AppName = "beego"
|
AppName = "beego"
|
||||||
|
Loading…
Reference in New Issue
Block a user