Skip to content

Commit 944d82a

Browse files
committed
docs(example): add CORS + DefaultAuthorizer example
1 parent 96a7ef8 commit 944d82a

File tree

8 files changed

+736
-0
lines changed

8 files changed

+736
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# api_lambda_auth_cors
2+
3+
## About
4+
5+
This example shows how to configure a TOKEN Lambda Authorizer as the `DefaultAuthorizer` for an API with CORS enabled.
6+
7+
## Installation
8+
9+
1. Provide a bucket name and deploy the resources
10+
```bash
11+
S3_BUCKET_NAME=your-bucket-name-here \
12+
npm run package-deploy
13+
```
14+
1. Install the required NPM dependencies
15+
```bash
16+
npm install
17+
```
18+
1. Start the web server
19+
```bash
20+
npm run start
21+
```
22+
1. Open `http://localhost:8080` in a browser, click the button and an alert will appear with the lambda response
23+
24+
## Cleanup
25+
26+
1. `aws cloudformation delete-stack --stack-name authorizer-cors-example`

0 commit comments

Comments
 (0)