Skip to content

Commit c396856

Browse files
author
Frank
committed
Update sst
1 parent 0fa3296 commit c396856

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

infra/app.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,18 @@ export const api = new sst.aws.Function("Api", {
2222
handler: "app/function/src/api.handler",
2323
link: [auth, postgres, ...AllSecrets],
2424
permissions: [{ actions: ["sts:*"], resources: ["*"] }],
25-
url: true,
25+
url: {
26+
route: {
27+
router,
28+
domain: `api-${domain}`,
29+
},
30+
},
2631
})
27-
router.route("api-" + domain, api.url)
2832

29-
const site = new sst.aws.StaticSite("Web", {
30-
cdn: false,
33+
new sst.aws.StaticSite("Web", {
34+
route: {
35+
router,
36+
},
3137
build: {
3238
command: "bun run build",
3339
output: "dist/client",
@@ -40,4 +46,3 @@ const site = new sst.aws.StaticSite("Web", {
4046
},
4147
path: "app/web",
4248
})
43-
router.routeSite(domain, site)

sst-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ declare module "sst" {
5151
}
5252
"Web": {
5353
"type": "sst.aws.StaticSite"
54+
"url": string
5455
}
5556
"Zero": {
5657
"service": string

0 commit comments

Comments
 (0)