-
Notifications
You must be signed in to change notification settings - Fork 0
/
sst.config.ts
44 lines (39 loc) · 953 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
42
43
44
/* eslint-disable */
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "solo",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
};
},
async run() {
const apiToken = new sst.Secret("APIToken");
const jwtSecret = new sst.Secret("JWTSecret");
const usersTable = new sst.aws.Dynamo("Users", {
fields: {
email: "string",
},
primaryIndex: { hashKey: "email" },
});
const hono = new sst.aws.Function("Hono", {
url: true,
handler: "src/api/index.handler",
link: [usersTable, jwtSecret, apiToken],
runtime: "nodejs20.x",
});
new sst.aws.StaticSite("Solo", {
build: {
command: "npm run build",
output: "dist",
},
environment: {
VITE_API_BASE_URL: hono.url,
},
});
return {
api: hono.url,
};
},
});