mirror of
https://github.com/fatedier/frp.git
synced 2025-07-13 09:19:46 +07:00
fix by golint (#1822)
This commit is contained in:
@ -37,7 +37,7 @@ func (svr *Service) RunDashboardServer(addr string, port int) (err error) {
|
||||
router := mux.NewRouter()
|
||||
|
||||
user, passwd := svr.cfg.DashboardUser, svr.cfg.DashboardPwd
|
||||
router.Use(frpNet.NewHttpAuthMiddleware(user, passwd).Middleware)
|
||||
router.Use(frpNet.NewHTTPAuthMiddleware(user, passwd).Middleware)
|
||||
|
||||
// metrics
|
||||
if svr.cfg.EnablePrometheus {
|
||||
@ -45,14 +45,14 @@ func (svr *Service) RunDashboardServer(addr string, port int) (err error) {
|
||||
}
|
||||
|
||||
// api, see dashboard_api.go
|
||||
router.HandleFunc("/api/serverinfo", svr.ApiServerInfo).Methods("GET")
|
||||
router.HandleFunc("/api/proxy/{type}", svr.ApiProxyByType).Methods("GET")
|
||||
router.HandleFunc("/api/proxy/{type}/{name}", svr.ApiProxyByTypeAndName).Methods("GET")
|
||||
router.HandleFunc("/api/traffic/{name}", svr.ApiProxyTraffic).Methods("GET")
|
||||
router.HandleFunc("/api/serverinfo", svr.APIServerInfo).Methods("GET")
|
||||
router.HandleFunc("/api/proxy/{type}", svr.APIProxyByType).Methods("GET")
|
||||
router.HandleFunc("/api/proxy/{type}/{name}", svr.APIProxyByTypeAndName).Methods("GET")
|
||||
router.HandleFunc("/api/traffic/{name}", svr.APIProxyTraffic).Methods("GET")
|
||||
|
||||
// view
|
||||
router.Handle("/favicon.ico", http.FileServer(assets.FileSystem)).Methods("GET")
|
||||
router.PathPrefix("/static/").Handler(frpNet.MakeHttpGzipHandler(http.StripPrefix("/static/", http.FileServer(assets.FileSystem)))).Methods("GET")
|
||||
router.PathPrefix("/static/").Handler(frpNet.MakeHTTPGzipHandler(http.StripPrefix("/static/", http.FileServer(assets.FileSystem)))).Methods("GET")
|
||||
|
||||
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/static/", http.StatusMovedPermanently)
|
||||
|
Reference in New Issue
Block a user