123456789101112131415161718192021222324
  1. // @APIVersion 1.0.0
  2. // @Title beego Test API
  3. // @Description beego has a very cool tools to autogenerate documents for your API
  4. // @Contact astaxie@gmail.com
  5. // @TermsOfServiceUrl http://beego.me/
  6. // @License Apache 2.0
  7. // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
  8. package routers
  9. import (
  10. "wechat-conf/controllers"
  11. "github.com/astaxie/beego"
  12. )
  13. func RouteInit() {
  14. ns := beego.NewNamespace("/api",
  15. // 解决跨域时 先发送 options 问题
  16. beego.NSRouter("*", &controllers.BaseController{}, "options:Options"),
  17. )
  18. beego.AddNamespace(ns)
  19. }