-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsst.config.ts
41 lines (38 loc) · 983 Bytes
/
sst.config.ts
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
40
41
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "aws-from-scratch-to-fullstack",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
profile:
input?.stage === "production"
? "fireship-production"
: "fireship-dev",
},
},
};
},
async run() {
const secretApiKey = new sst.Secret("ApiKey");
const backend = new sst.aws.Function("Backend", {
url: true,
handler: "./apps/backend/src/index.handler",
runtime: "nodejs20.x",
architecture: "arm64",
streaming: !$dev,
link: [secretApiKey],
});
const frontend = new sst.aws.Remix("Frontend", {
path: "apps/frontend/",
environment: {},
link: [backend, secretApiKey],
});
return {
backend: backend.url,
frontend: frontend.url,
};
},
});