Try to abstract the core package.
This commit is contained in:
6
main.go
6
main.go
@ -3,9 +3,9 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/eyebluecn/tank/code/config"
|
||||
"github.com/eyebluecn/tank/code/core"
|
||||
"github.com/eyebluecn/tank/code/rest"
|
||||
"github.com/eyebluecn/tank/code/support"
|
||||
"github.com/eyebluecn/tank/code/tool/inter"
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"log"
|
||||
"net/http"
|
||||
@ -17,7 +17,7 @@ func main() {
|
||||
tankLogger := &support.TankLogger{}
|
||||
tankLogger.Init()
|
||||
defer tankLogger.Destroy()
|
||||
inter.LOGGER = tankLogger
|
||||
core.LOGGER = tankLogger
|
||||
|
||||
//装载配置文件,这个决定了是否需要执行安装过程
|
||||
config.CONFIG.Init()
|
||||
@ -28,7 +28,7 @@ func main() {
|
||||
|
||||
http.Handle("/", rest.CONTEXT.Router)
|
||||
|
||||
inter.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)
|
||||
core.LOGGER.Info("App started at http://localhost:%v", config.CONFIG.ServerPort)
|
||||
|
||||
dotPort := fmt.Sprintf(":%v", config.CONFIG.ServerPort)
|
||||
err1 := http.ListenAndServe(dotPort, nil)
|
||||
|
Reference in New Issue
Block a user