Commit 66245c3a32b1b431e837d1dba3e04d6fe9cbd689

Authored by Administrator
1 parent f073e81d
Exists in master

fix dir problem

conf/app.conf
1 1 appname = abc
2   -httpport = 8080
  2 +httpport = 80
3 3 runmode = dev
... ...
controllers/default.go
... ... @@ -4,13 +4,13 @@ import (
4 4 "github.com/astaxie/beego"
5 5 )
6 6  
7   -type MainController struct {
  7 +type HomeController struct {
8 8 beego.Controller
9 9 }
10 10  
11 11  
12   -func (c *MainController) Get() {
13   - c.TplName = "home.html"
  12 +func (this *HomeController) Get() {
  13 + this.TplName = "home.html"
14 14  
15 15  
16 16 }
... ...
main.go
1 1 package main
2 2  
3 3 import (
4   - _ "abc/routers"
  4 + _ "go_blog/routers"
5 5 "github.com/astaxie/beego"
6   - "./models"
  6 + "go_blog/models"
7 7 "github.com/astaxie/beego/orm"
8 8 )
9 9  
... ...
routers/router.go
1 1 package routers
2 2  
3 3 import (
4   - "abc/controllers"
  4 + "go_blog/controllers"
5 5 "github.com/astaxie/beego"
6 6 )
7 7  
8 8 func init() {
9   - beego.Router("/", &controllers.MainController{})
  9 + beego.Router("/", &controllers.HomeController{})
10 10 }
... ...