dummy site READY

main
Bel LaPointe 2024-12-14 19:44:28 -07:00
parent 33f2771014
commit c47d2d7456
1 changed files with 12 additions and 1 deletions

View File

@ -124,6 +124,11 @@ func (s *S) injectContext(w http.ResponseWriter, r *http.Request) error {
return nil return nil
} }
func (s *S) Session(ctx context.Context) Session {
v, _ := ctx.Value("session").(Session)
return v
}
func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error { func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error {
ctx := r.Context() ctx := r.Context()
@ -167,5 +172,11 @@ func (s *S) serveWS(w http.ResponseWriter, r *http.Request) error {
} }
func (s *S) serveV1(w http.ResponseWriter, r *http.Request) error { func (s *S) serveV1(w http.ResponseWriter, r *http.Request) error {
return fmt.Errorf("not impl: v1") ctx := r.Context()
switch r.Method + r.URL.Path {
case "PUT/v1/state/" + s.Session(ctx).ID + "/party":
return nil
}
http.NotFound(w, r)
return nil
} }