Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pm-stack/console/edge/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class PmEdge extends DurableObject<Env> {
// The app says "ping" to keep its connection from being dropped as
// idle; the platform answers "pong" itself, without waking this.
ctx.setWebSocketAutoResponse(new WebSocketRequestResponsePair("ping", "pong"));
const bridge = env.BRIDGE;
this.edge = new Edge({
fetchImpl: keysFetch(env),
kv: {
Expand All @@ -96,9 +97,9 @@ export class PmEdge extends DurableObject<Env> {
bridgeToken: env.BRIDGE_TOKEN,
// The binding's fetch, shaped as the fetch the classes take:
// not to be called as a method, like the platform's own.
bridgeFetch: env.BRIDGE
bridgeFetch: bridge
? (url: string | URL | Request, init?: RequestInit) =>
env.BRIDGE.fetch(new Request(url as string, init))
bridge.fetch(new Request(url as string, init))
: undefined,
githubApi: env.GITHUB_API_ORIGIN,
queueDb: env.QUEUE_DB_ORIGIN,
Expand Down