-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsst.config.ts
More file actions
39 lines (35 loc) · 1.32 KB
/
sst.config.ts
File metadata and controls
39 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "clawstore",
removal: input?.stage === "production" ? "retain" : "remove",
providers: {
cloudflare: true,
},
home: "cloudflare",
};
},
async run() {
// ── Storage ──────────────────────────────────────────────
const db = new sst.cloudflare.D1("Database");
const bucket = new sst.cloudflare.Bucket("Tarballs");
const kv = new sst.cloudflare.Kv("RateLimit");
// ── API Worker ───────────────────────────────────────────
const api = new sst.cloudflare.Worker("Api", {
handler: "apps/api/src/index.ts",
url: true,
link: [db, bucket, kv],
});
// ── Web Worker ───────────────────────────────────────────
// Uncomment when web app build is wired up:
// const web = new sst.cloudflare.Worker("Web", {
// handler: "apps/web/.output/server/index.mjs",
// url: true,
// link: [api],
// });
return {
apiUrl: api.url,
};
},
});