summaryrefslogtreecommitdiffhomepage
path: root/app/infra
diff options
context:
space:
mode:
Diffstat (limited to 'app/infra')
-rw-r--r--app/infra/app.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/app/infra/app.ts b/app/infra/app.ts
new file mode 100644
index 000000000..1a97740f4
--- /dev/null
+++ b/app/infra/app.ts
@@ -0,0 +1,36 @@
+const bucket = new sst.cloudflare.Bucket("Bucket")
+
+export const api = new sst.cloudflare.Worker("Api", {
+ handler: "packages/function/src/api.ts",
+ url: true,
+ link: [bucket],
+ transform: {
+ worker: (args) => {
+ 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",
+ environment: {
+ VITE_API_URL: api.url,
+ },
+ errorPage: "fallback.html",
+ build: {
+ command: "bun run build",
+ output: "dist/client",
+ },
+})