summaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-05-30 20:47:56 -0400
committerDax Raad <[email protected]>2025-05-30 20:48:36 -0400
commitf3da73553c45f17e04b1e77cb13eb0fca714d1bd (patch)
treea24317a19e1ab2a89da50db669dc6894f15d00d1 /infra
parent9a26b3058ffc1023e5c7e54b6d571c903d15888e (diff)
downloadopencode-f3da73553c45f17e04b1e77cb13eb0fca714d1bd.tar.gz
opencode-f3da73553c45f17e04b1e77cb13eb0fca714d1bd.zip
sync
Diffstat (limited to 'infra')
-rw-r--r--infra/app.ts44
1 files changed, 44 insertions, 0 deletions
diff --git a/infra/app.ts b/infra/app.ts
new file mode 100644
index 000000000..73b80994d
--- /dev/null
+++ b/infra/app.ts
@@ -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",
+ },
+})