mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-04 00:14:59 +01:00
sync
This commit is contained in:
44
infra/app.ts
Normal file
44
infra/app.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export const domain = (() => {
|
||||
if ($app.stage === "production") return "opencode.ai"
|
||||
if ($app.stage === "dev") return "dev.opencode.ai"
|
||||
return `${$app.stage}.dev.opencode.ai`
|
||||
})()
|
||||
|
||||
const bucket = new sst.cloudflare.Bucket("Bucket")
|
||||
|
||||
export const api = new sst.cloudflare.Worker("Api", {
|
||||
domain: `api.${domain}`,
|
||||
handler: "packages/function/src/api.ts",
|
||||
url: true,
|
||||
link: [bucket],
|
||||
transform: {
|
||||
worker: (args) => {
|
||||
args.logpush = true
|
||||
args.bindings = $resolve(args.bindings).apply((bindings) => [
|
||||
...bindings,
|
||||
{
|
||||
name: "SYNC_SERVER",
|
||||
type: "durable_object_namespace",
|
||||
className: "SyncServer",
|
||||
},
|
||||
])
|
||||
args.migrations = {
|
||||
oldTag: "v1",
|
||||
newTag: "v1",
|
||||
//newSqliteClasses: ["SyncServer"],
|
||||
}
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
new sst.cloudflare.StaticSite("Web", {
|
||||
path: "packages/web",
|
||||
domain,
|
||||
environment: {
|
||||
VITE_API_URL: api.url,
|
||||
},
|
||||
build: {
|
||||
command: "bun run build",
|
||||
output: "dist",
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user