router.go 892B

12345678910111213141516171819202122232425
  1. package routers
  2. import (
  3. "Kya_New/controllers/login"
  4. "Kya_New/controllers/manage"
  5. "Kya_New/controllers/patient"
  6. "github.com/astaxie/beego"
  7. "github.com/astaxie/beego/plugins/cors"
  8. )
  9. func init() {
  10. //beego.Router("/", &controllers.MainController{})
  11. beego.InsertFilter("*", beego.BeforeRouter, cors.Allow(&cors.Options{
  12. AllowOrigins: []string{"http://localhost:8090", "http://localhost:8091", "http://mt.sgjyun.com"},
  13. AllowMethods: []string{"Get", "Post", "PUT", "DELETE", "OPTIONS"},
  14. AllowHeaders: []string{"Origin", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  15. ExposeHeaders: []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
  16. AllowCredentials: true,
  17. }))
  18. login.LoginRegisterRouter()
  19. patient.PatientRegisterRouter()
  20. manage.ManageRegisterRouter()
  21. }