32 lines
532 B
Go
32 lines
532 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"cloud.o-forge.io/core/oc-catalog/routers"
|
|
"cloud.o-forge.io/core/oc-catalog/services"
|
|
|
|
beego "github.com/beego/beego/v2/server/web"
|
|
)
|
|
|
|
func main() {
|
|
|
|
// If we have any parameter, we run the beego directly
|
|
if len(os.Args) > 1 {
|
|
beego.Run()
|
|
}
|
|
|
|
routers.Init()
|
|
services.Init()
|
|
|
|
if beego.BConfig.RunMode == "dev" {
|
|
// beego.BConfig.WebConfig.DirectoryIndex = true
|
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
}
|
|
beego.Run()
|
|
|
|
defer func() {
|
|
services.MongoDisconnect()
|
|
}()
|
|
}
|