2023-08-26 22:04:56 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-02-15 10:48:40 +01:00
|
|
|
conf "oc-search/conf"
|
2023-08-26 22:04:56 +02:00
|
|
|
_ "oc-search/routers"
|
|
|
|
_ "oc-search/views"
|
|
|
|
|
2023-10-25 11:46:14 +02:00
|
|
|
"github.com/beego/beego/logs"
|
2023-08-26 22:04:56 +02:00
|
|
|
beego "github.com/beego/beego/v2/server/web"
|
|
|
|
)
|
|
|
|
|
2023-10-25 11:46:14 +02:00
|
|
|
|
2023-08-26 22:04:56 +02:00
|
|
|
func main() {
|
2023-10-26 10:59:21 +02:00
|
|
|
|
|
|
|
loadConfig()
|
|
|
|
|
|
|
|
beego.BConfig.WebConfig.Session.SessionOn = true
|
|
|
|
beego.SetStaticPath("/favicon.ico", "/static/favicon.ico")
|
|
|
|
beego.BConfig.WebConfig.DirectoryIndex = true
|
|
|
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
|
|
|
|
|
|
beego.Run()
|
|
|
|
}
|
|
|
|
|
|
|
|
// Initialising the config in the init so that the oc-catalog API receives it
|
|
|
|
|
|
|
|
func loadConfig(){
|
2023-10-25 11:46:14 +02:00
|
|
|
log := logs.NewLogger(10000)
|
|
|
|
log.SetLogger("console")
|
|
|
|
|
2024-02-16 10:23:22 +01:00
|
|
|
|
2023-08-26 22:04:56 +02:00
|
|
|
beego.BConfig.WebConfig.Session.SessionOn = true
|
|
|
|
beego.SetStaticPath("/favicon.ico", "/static/favicon.ico")
|
|
|
|
beego.BConfig.WebConfig.DirectoryIndex = true
|
|
|
|
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
|
|
|
|
|
2024-02-15 10:48:40 +01:00
|
|
|
logs.Info("Will contact oc-catalog at : %v", conf.GetConfig().OcCatalogUrl)
|
|
|
|
|
2023-08-26 22:04:56 +02:00
|
|
|
beego.Run()
|
|
|
|
}
|