Handle URLs with an extraneous /backend/ prefix (#1)
* handle /backend in URLs as speedtest_worker.js is set up to do so * fixed dropped slashes
This commit is contained in:
parent
30c56a0d46
commit
8971ba8117
12
web/web.go
12
web/web.go
@ -47,19 +47,31 @@ func ListenAndServe(conf *config.Config) error {
|
||||
log.Infof("Starting backend server on %s", net.JoinHostPort(conf.BindAddress, conf.Port))
|
||||
r.Get("/*", pages)
|
||||
r.HandleFunc("/empty", empty)
|
||||
r.HandleFunc("/backend/empty", empty)
|
||||
r.Get("/garbage", garbage)
|
||||
r.Get("/backend/garbage", garbage)
|
||||
r.Get("/getIP", getIP)
|
||||
r.Get("/backend/getIP", getIP)
|
||||
r.Get("/results", results.DrawPNG)
|
||||
r.Get("/results/", results.DrawPNG)
|
||||
r.Get("/backend/results", results.DrawPNG)
|
||||
r.Get("/backend/results/", results.DrawPNG)
|
||||
r.Post("/results/telemetry", results.Record)
|
||||
r.Post("/backend/results/telemetry", results.Record)
|
||||
r.HandleFunc("/stats", results.Stats)
|
||||
r.HandleFunc("/backend/stats", results.Stats)
|
||||
|
||||
// PHP frontend default values compatibility
|
||||
r.HandleFunc("/empty.php", empty)
|
||||
r.HandleFunc("/backend/empty.php", empty)
|
||||
r.Get("/garbage.php", garbage)
|
||||
r.Get("/backend/garbage.php", garbage)
|
||||
r.Get("/getIP.php", getIP)
|
||||
r.Get("/backend/getIP.php", getIP)
|
||||
r.Post("/results/telemetry.php", results.Record)
|
||||
r.Post("/backend/results/telemetry.php", results.Record)
|
||||
r.HandleFunc("/stats.php", results.Stats)
|
||||
r.HandleFunc("/backend/stats.php", results.Stats)
|
||||
|
||||
return http.ListenAndServe(net.JoinHostPort(conf.BindAddress, conf.Port), r)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user