mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-12-05 14:44:41 -05:00
Add local-first race hub API
This commit is contained in:
1 parent
517c6b987b
commit
e08255db70
16 files changed
+1231
-118
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user