31 lines
805 B
Go
31 lines
805 B
Go
package main
|
|
|
|
import (
|
|
_ "multitenantStack/routers"
|
|
companydb "multitenantStack/services/companydb"
|
|
"multitenantStack/services/tokenTools"
|
|
"time"
|
|
|
|
"github.com/astaxie/beego"
|
|
"github.com/astaxie/beego/orm"
|
|
_ "github.com/lib/pq"
|
|
)
|
|
|
|
func init() {
|
|
orm.RegisterDataBase("default", "postgres", "host=127.0.0.1 port=5435 user=postgres password=postgre sslmode=disable")
|
|
orm.RegisterDataBase("system", "postgres", "host=127.0.0.1 port=5435 user=postgres password=postgre dbname=system sslmode=disable")
|
|
|
|
tokenTools.InitTokenToolsService()
|
|
companydb.InitCompanyDBService()
|
|
orm.DefaultTimeLoc = time.UTC
|
|
if beego.BConfig.RunMode == "dev" {
|
|
beego.BConfig.WebConfig.DirectoryIndex = true
|
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
orm.Debug = true
|
|
}
|
|
}
|
|
|
|
func main() {
|
|
beego.Run()
|
|
}
|