Removed Beego routing/controllers, converted to Chi.

Also introduced Wire for dependency injection
This commit is contained in:
Deluan 2020-01-07 14:56:26 -05:00 committed by Deluan Quintão
parent 1f4dfcb853
commit 79701caca3
31 changed files with 1603 additions and 1188 deletions

14
main.go
View file

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/astaxie/beego"
"github.com/cloudsonic/sonic-server/api"
"github.com/cloudsonic/sonic-server/conf"
_ "github.com/cloudsonic/sonic-server/init"
_ "github.com/cloudsonic/sonic-server/tasks"
@ -13,13 +14,10 @@ func main() {
conf.LoadFromLocalFile()
conf.LoadFromFlags()
beego.BConfig.RunMode = conf.Sonic.RunMode
beego.BConfig.Listen.HTTPPort = conf.Sonic.Port
fmt.Printf("\nCloudSonic Server v%s (%s mode)\n\n", "0.2", beego.BConfig.RunMode)
fmt.Printf("\nCloudSonic Server v%s (%s mode)\n\n", "0.1", beego.BConfig.RunMode)
if beego.BConfig.RunMode == "prod" {
beego.SetLevel(beego.LevelInformational)
}
beego.Run()
a := App{}
a.Initialize()
a.MountRouter("/rest/", api.Router())
a.Run(":" + conf.Sonic.Port)
}