router.go 581 字节
package routers

import (
	"ability/controllers/v1"
	"github.com/astaxie/beego"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)

var nsV1 *beego.Namespace

func init() {
	nsV1 := beego.NewNamespace("v1",
		beego.NSNamespace("auth", beego.NSInclude(&v1.AuthController{})),
		beego.NSNamespace("upload", beego.NSInclude(&v1.UploadController{})),
		beego.NSNamespace("version", beego.NSInclude(&v1.VersionController{})),
	)
	beego.AddNamespace(nsV1)
	beego.SetStaticPath("/file/ab", beego.AppConfig.String("source_path"))
	beego.Handler("/metrics", promhttp.Handler())
}