-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
44 lines (36 loc) · 1.11 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package main
import (
_ "github.com/udistrital/plan_cuentas_mid/routers"
//"github.com/udistrital/utils_oas/customerror"
"github.com/astaxie/beego"
"github.com/astaxie/beego/plugins/cors"
apistatus "github.com/udistrital/utils_oas/apiStatusLib"
"github.com/udistrital/utils_oas/auditoria"
)
func init() {
}
func main() {
// beego.BConfig.RecoverFunc = responseformat.GlobalResponseHandler
if beego.BConfig.RunMode == "dev" {
beego.BConfig.WebConfig.DirectoryIndex = true
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
}
beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
AllowOrigins: []string{"*"},
AllowMethods: []string{"PUT", "PATCH", "GET", "POST", "OPTIONS", "DELETE"},
AllowHeaders: []string{"Origin", "x-requested-with",
"content-type",
"accept",
"origin",
"authorization",
"x-csrftoken"},
ExposeHeaders: []string{"Content-Length"},
AllowCredentials: true,
}))
//Prueba de auditoria
auditoria.InitMiddleware()
//beego.ErrorController(&customerror.CustomErrorController{})
apistatus.Init()
//mongoProcess.PresupuestoMongoJobInit()
beego.Run()
}