Commit 23229ef9 authored by astaxie's avatar astaxie

beego: BeegoServerName & beego.Run

BeegoServerName change to beegoServer+Version
beego.Run(“:8089”)
parent 0d17d974
...@@ -284,8 +284,19 @@ func AddAPPStartHook(hf hookfunc) { ...@@ -284,8 +284,19 @@ func AddAPPStartHook(hf hookfunc) {
} }
// Run beego application. // Run beego application.
// it's alias of App.Run. // beego.Run() default run on HttpPort
func Run() { // beego.Run(":8089")
// beego.Run("127.0.0.1:8089")
func Run(params ...string) {
if len(params) > 0 && params[0] != "" {
strs := strings.Split(params[0], ":")
if len(strs) > 0 && strs[0] != "" {
HttpAddr = strs[0]
}
if len(strs) > 1 && strs[1] != "" {
HttpPort, _ = strconv.Atoi(strs[1])
}
}
initBeforeHttpRun() initBeforeHttpRun()
if EnableAdmin { if EnableAdmin {
...@@ -346,6 +357,7 @@ func initBeforeHttpRun() { ...@@ -346,6 +357,7 @@ func initBeforeHttpRun() {
middleware.RegisterErrorHandler() middleware.RegisterErrorHandler()
} }
// this function is for test package init
func TestBeegoInit(apppath string) { func TestBeegoInit(apppath string) {
AppPath = apppath AppPath = apppath
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
......
...@@ -142,7 +142,7 @@ func init() { ...@@ -142,7 +142,7 @@ func init() {
TemplateLeft = "{{" TemplateLeft = "{{"
TemplateRight = "}}" TemplateRight = "}}"
BeegoServerName = "beegoServer" BeegoServerName = "beegoServer:" + VERSION
EnableAdmin = false EnableAdmin = false
AdminHttpAddr = "127.0.0.1" AdminHttpAddr = "127.0.0.1"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment