Skip to content

Commit 5239c0e

Browse files
retepsdevksingh4
andauthored
add setup docs (#1)
* add setup docs * Update README.md --------- Co-authored-by: Dev Singh <[email protected]>
1 parent d8cdeac commit 5239c0e

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
EVENTS_API_CLIENT_SECRET=XXX

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,35 @@
22

33
## Run Locally
44
1. `yarn -D`
5-
2. `make local`
5+
2. `make check_account_dev` - If this fails make sure that AWS is configured.
6+
3. `make local`
67

78
## Build for AWS Lambda
89
1. `make clean`
910
2. `make build`
1011

1112
## Deploy to AWS env
13+
1214
1. Get AWS credentials with `aws configure sso`
1315
2. Ensure AWS profile is set to the right account (DEV or PROD).
14-
3. Run `make deploy_dev` or `make deploy_prod`.
16+
3. Run `make deploy_dev` or `make deploy_prod`.
17+
18+
## Generating JWT token
19+
20+
Create a `.env` file containing your `CLIENT_SECRET`.
21+
22+
```bash
23+
node --env-file=.env get_msft_jwt.js
24+
```
25+
26+
## Configuring AWS
27+
28+
```
29+
aws configure sso
30+
```
31+
32+
Log in with SSO. Then, export the `AWS_PROFILE` that the above command outputted.
33+
34+
```bash
35+
export AWS_PROFILE=ABC-DEV
36+
```

src/routes/events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ const eventsPlugin: FastifyPluginAsync = async (fastify, _options) => {
247247
} catch (e: unknown) {
248248
if (e instanceof Error) {
249249
request.log.error("Failed to get from DynamoDB: " + e.toString());
250+
} else {
251+
request.log.error(`Failed to get from DynamoDB. ${e}`);
250252
}
251253
throw new DatabaseFetchError({
252254
message: "Failed to get events from Dynamo table.",

0 commit comments

Comments
 (0)