initial commit
This commit is contained in:
31
main.go
Normal file
31
main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
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()
|
||||
}()
|
||||
}
|
||||
Reference in New Issue
Block a user