package routers import ( "KYA/controllers/login" "KYA/controllers/manage" "KYA/controllers/patient" "github.com/astaxie/beego" "github.com/astaxie/beego/plugins/cors" ) func init() { //beego.Router("/", &controllers.MainController{}) beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{ AllowOrigins: []string{"http://localhost:8090", "http://localhost:8091", "http://mt.sgjyun.com"}, AllowMethods: []string{"Get", "Post", "PUT", "DELETE", "OPTIONS"}, AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"}, ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"}, AllowCredentials: true, })) login.LoginRegisterRouter() patient.PatientRegisterRouter() manage.ManageRegisterRouter() }