MCPcopy
hub / github.com/partykit/partykit / onFetch

Function onFetch

examples/basic/src/server.ts:26–31  ·  view source on GitHub ↗
(req, lobby, _ctx)

Source from the content-addressed store, hash-verified

24
25export default {
26 async onFetch(req, lobby, _ctx) {
27 const url = new URL(req.url);
28 if (url.pathname === "/another") {
29 return lobby.assets.fetch("/another.html");
30 }
31 },
32 async onSocket(
33 socket: FetchSocket,
34 _env: FetchLobby,

Callers 1

fetchFunction · 0.50

Calls 1

fetchMethod · 0.45

Tested by

no test coverage detected