(req: Party.Request, lobby: Party.Lobby)
| 8 | // onBefore* handlers that run in the worker nearest the user are now |
| 9 | // explicitly marked static, because they have no access to Party state |
| 10 | static async onBeforeRequest(req: Party.Request, lobby: Party.Lobby) { |
| 11 | await lobby.parties.main.get(lobby.id).fetch("/foo"); |
| 12 | await lobby.parties.main.get(lobby.id).fetch(req); |
| 13 | |
| 14 | await lobby.parties.main.get(lobby.id).fetch(req.url, req); |
| 15 | |
| 16 | return req; |
| 17 | } |
| 18 | static async onBeforeConnect(req: Party.Request) { |
| 19 | return req; |
| 20 | } |