oc-shared/main.go

25 lines
623 B
Go
Raw Normal View History

2024-08-12 14:12:51 +02:00
package main
import (
_ "oc-shared/routers"
oclib "cloud.o-forge.io/core/oc-lib"
beego "github.com/beego/beego/v2/server/web"
2025-01-15 16:32:57 +01:00
"github.com/beego/beego/v2/server/web/filter/cors"
2024-08-12 14:12:51 +02:00
)
2024-09-04 16:33:21 +02:00
const appname = "oc-shared"
2024-08-12 14:12:51 +02:00
func main() {
2024-09-04 16:33:21 +02:00
// Init the oc-lib
oclib.Init(appname)
2025-01-15 16:32:57 +01:00
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
AllowAllOrigins: true,
AllowMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
AllowHeaders: []string{"Origin", "Authorization", "Content-Type"},
ExposeHeaders: []string{"Content-Length", "Content-Type"},
AllowCredentials: true,
}))
2024-08-12 14:12:51 +02:00
beego.Run()
}