mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
fix webdomain
This commit is contained in:
parent
a54c5c6298
commit
aeea84a877
2 changed files with 5 additions and 1 deletions
|
@ -9,6 +9,9 @@ const bucket = new sst.cloudflare.Bucket("Bucket")
|
||||||
export const api = new sst.cloudflare.Worker("Api", {
|
export const api = new sst.cloudflare.Worker("Api", {
|
||||||
domain: `api.${domain}`,
|
domain: `api.${domain}`,
|
||||||
handler: "packages/function/src/api.ts",
|
handler: "packages/function/src/api.ts",
|
||||||
|
environment: {
|
||||||
|
WEB_DOMAIN: domain,
|
||||||
|
},
|
||||||
url: true,
|
url: true,
|
||||||
link: [bucket],
|
link: [bucket],
|
||||||
transform: {
|
transform: {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { randomUUID } from "node:crypto"
|
||||||
type Env = {
|
type Env = {
|
||||||
SYNC_SERVER: DurableObjectNamespace<SyncServer>
|
SYNC_SERVER: DurableObjectNamespace<SyncServer>
|
||||||
Bucket: R2Bucket
|
Bucket: R2Bucket
|
||||||
|
WEB_DOMAIN: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SyncServer extends DurableObject<Env> {
|
export class SyncServer extends DurableObject<Env> {
|
||||||
|
@ -127,7 +128,7 @@ export default {
|
||||||
return new Response(
|
return new Response(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
secret,
|
secret,
|
||||||
url: "https://opencode.ai/s/" + short,
|
url: `https://${env.WEB_DOMAIN}/s/${short}`,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
headers: { "Content-Type": "application/json" },
|
headers: { "Content-Type": "application/json" },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue