Use proper methods and fix redirect handler
This commit is contained in:
parent
d2d8e6ecad
commit
64551704a3
12
main.go
12
main.go
|
@ -114,12 +114,12 @@ func main() {
|
||||||
r.Use(RealIPMiddleware)
|
r.Use(RealIPMiddleware)
|
||||||
r.Use(logger.Logger("router", log.StandardLogger()))
|
r.Use(logger.Logger("router", log.StandardLogger()))
|
||||||
|
|
||||||
r.HandleFunc("/status", statusHandler)
|
r.Get("/status", statusHandler)
|
||||||
r.HandleFunc("/mirrors", mirrorsHandler)
|
r.Get("/mirrors", mirrorsHandler)
|
||||||
r.HandleFunc("/reload", reloadHandler)
|
r.Post("/reload", reloadHandler)
|
||||||
r.HandleFunc("/dl_map", dlMapHandler)
|
r.Get("/dl_map", dlMapHandler)
|
||||||
r.Handle("/metrics", promhttp.Handler())
|
r.Get("/metrics", promhttp.Handler().ServeHTTP)
|
||||||
r.HandleFunc("/", redirectHandler)
|
r.HandleFunc("/*", redirectHandler)
|
||||||
|
|
||||||
go http.ListenAndServe(viper.GetString("bind"), r)
|
go http.ListenAndServe(viper.GetString("bind"), r)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue