Use proper methods and fix redirect handler
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Tyler 2022-03-30 22:08:51 -04:00
parent d2d8e6ecad
commit 64551704a3

12
main.go
View File

@ -114,12 +114,12 @@ func main() {
r.Use(RealIPMiddleware)
r.Use(logger.Logger("router", log.StandardLogger()))
r.HandleFunc("/status", statusHandler)
r.HandleFunc("/mirrors", mirrorsHandler)
r.HandleFunc("/reload", reloadHandler)
r.HandleFunc("/dl_map", dlMapHandler)
r.Handle("/metrics", promhttp.Handler())
r.HandleFunc("/", redirectHandler)
r.Get("/status", statusHandler)
r.Get("/mirrors", mirrorsHandler)
r.Post("/reload", reloadHandler)
r.Get("/dl_map", dlMapHandler)
r.Get("/metrics", promhttp.Handler().ServeHTTP)
r.HandleFunc("/*", redirectHandler)
go http.ListenAndServe(viper.GetString("bind"), r)