summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-07-03 09:58:25 -0400
committerDax Raad <[email protected]>2025-07-03 09:58:25 -0400
commitaeea84a87762e94e5903942e8ef0727be9c159a5 (patch)
treecd44c3e6a2df97d538f5faf7e39e9bd5f846db0d
parenta54c5c629802a5645a116c2a1542386cfde029d2 (diff)
downloadopencode-aeea84a87762e94e5903942e8ef0727be9c159a5.tar.gz
opencode-aeea84a87762e94e5903942e8ef0727be9c159a5.zip
fix webdomain
-rw-r--r--infra/app.ts3
-rw-r--r--packages/function/src/api.ts3
2 files changed, 5 insertions, 1 deletions
diff --git a/infra/app.ts b/infra/app.ts
index 1123e3a6b..834936b71 100644
--- a/infra/app.ts
+++ b/infra/app.ts
@@ -9,6 +9,9 @@ const bucket = new sst.cloudflare.Bucket("Bucket")
export const api = new sst.cloudflare.Worker("Api", {
domain: `api.${domain}`,
handler: "packages/function/src/api.ts",
+ environment: {
+ WEB_DOMAIN: domain,
+ },
url: true,
link: [bucket],
transform: {
diff --git a/packages/function/src/api.ts b/packages/function/src/api.ts
index 0d5e44df1..701b9854b 100644
--- a/packages/function/src/api.ts
+++ b/packages/function/src/api.ts
@@ -4,6 +4,7 @@ import { randomUUID } from "node:crypto"
type Env = {
SYNC_SERVER: DurableObjectNamespace<SyncServer>
Bucket: R2Bucket
+ WEB_DOMAIN: string
}
export class SyncServer extends DurableObject<Env> {
@@ -127,7 +128,7 @@ export default {
return new Response(
JSON.stringify({
secret,
- url: "https://opencode.ai/s/" + short,
+ url: `https://${env.WEB_DOMAIN}/s/${short}`,
}),
{
headers: { "Content-Type": "application/json" },