(req: Party.Request)
| 87 | onFetch = Server.onFetch; |
| 88 | |
| 89 | async onRequest(req: Party.Request): Promise<Response> { |
| 90 | const url = new URL(req.url); |
| 91 | if (url.pathname.endsWith(`/user-count`) && req.method === "GET") { |
| 92 | console.log("user-count", [...this.room.getConnections()].length); |
| 93 | return new Response([...this.room.getConnections()].length.toString()); |
| 94 | } |
| 95 | return super.onRequest(req); |
| 96 | } |
| 97 | } |
nothing calls this directly
no test coverage detected