From c47d2d74563d6560791eca9bd4b712f8636c2215 Mon Sep 17 00:00:00 2001 From: Bel LaPointe <153096461+breel-render@users.noreply.github.com> Date: Sat, 14 Dec 2024 19:44:28 -0700 Subject: [PATCH] dummy site READY --- cmd/testapi/main.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/testapi/main.go b/cmd/testapi/main.go index a7f89c0..a832b26 100644 --- a/cmd/testapi/main.go +++ b/cmd/testapi/main.go @@ -124,6 +124,11 @@ func (s *S) injectContext(w http.ResponseWriter, r *http.Request) error { 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 { 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 { - 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 }