router.go 686 字节
package routers

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

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())
	beego.Handler("/upgrage",http.HandlerFunc(websocket.Upgrage))
}