Add local-first race hub API

This commit is contained in:
2026-05-25 00:49:13 -04:00
parent 517c6b987b
commit e08255db70
16 changed files with 1231 additions and 118 deletions

24
internal/web/source.go Normal file
View File

@@ -0,0 +1,24 @@
package web
import "net/http"
const (
sourceOpenF1 = "openf1"
sourceLocal = "local"
sourceAuto = "auto"
)
func parseSourceMode(r *http.Request) string {
switch r.URL.Query().Get("source") {
case sourceLocal:
return sourceLocal
case sourceAuto:
return sourceAuto
default:
return sourceOpenF1
}
}
func (s *Server) hasLocalQuery() bool {
return s.query != nil
}