add data API calls

- /api/v1/data/status.txt
- /api/v1/data/servers.json
- /api/v1/data/servers.txt
This commit is contained in:
Reese Norris
2024-10-13 10:53:59 -07:00
parent 5b10de9df9
commit 95a30294f4
6 changed files with 239 additions and 24 deletions

View File

@@ -51,6 +51,11 @@ func (s *HTTPService) boot(ctx context.Context, listener net.Listener) (err erro
// data feed
mux.HandleFunc("GET /api/v1/data/openfsd-data.json", web.DataFeedHandler)
// status.txt, servers.txt, servers.json
mux.HandleFunc("GET /api/v1/data/status.txt", web.StatusTxtHandler)
mux.HandleFunc("GET /api/v1/data/servers.txt", web.ServerListTxtHandler)
mux.HandleFunc("GET /api/v1/data/servers.json", web.ServerListJsonHandler)
// favicon
mux.HandleFunc("/favicon.ico", web.FaviconHandler)