GeezerVison is showing github.com — fix webdomain · klimkin/opencode@aeea84a
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: infra/app.ts +3Lines changed: 3 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -9,6 +9,9 @@ const bucket = new sst.cloudflare.Bucket("Bucket") |
9 | 9 | export const api = new sst.cloudflare.Worker("Api", { |
10 | 10 | domain: `api.${domain}`, |
11 | 11 | handler: "packages/function/src/api.ts", |
| 12 | + environment: { |
| 13 | + WEB_DOMAIN: domain, |
| 14 | + }, |
12 | 15 | url: true, |
13 | 16 | link: [bucket], |
14 | 17 | transform: { |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/function/src/api.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,6 +4,7 @@ import { randomUUID } from "node:crypto" |
4 | 4 | type Env = { |
5 | 5 | SYNC_SERVER: DurableObjectNamespace<SyncServer> |
6 | 6 | Bucket: R2Bucket |
| 7 | + WEB_DOMAIN: string |
7 | 8 | } |
8 | 9 |
|
9 | 10 | export class SyncServer extends DurableObject<Env> { |
@@ -127,7 +128,7 @@ export default { |
127 | 128 | return new Response( |
128 | 129 | JSON.stringify({ |
129 | 130 | secret, |
130 | | - url: "https://opencode.ai/s/" + short, |
| 131 | + url: `https://${env.WEB_DOMAIN}/s/${short}`, |
131 | 132 | }), |
132 | 133 | { |
133 | 134 | headers: { "Content-Type": "application/json" }, |
|