dummy site READY
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user