Skip to content

Commit 36bb3a4

Browse files
committed
Add maxAge property documentation
1 parent 108c8c9 commit 36bb3a4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ provider:
179179
name: aws
180180
apiGateway:
181181
# REST API resource ID. Default is generated by the framework
182-
restApiId: xxxxxxxxxx
182+
restApiId: xxxxxxxxxx
183183
# Root resource, represent as / path
184-
restApiRootResourceId: xxxxxxxxxx
184+
restApiRootResourceId: xxxxxxxxxx
185185
186186
functions:
187187
...
@@ -197,7 +197,7 @@ provider:
197197
restApiId: xxxxxxxxxx
198198
restApiRootResourceId: xxxxxxxxxx
199199
# List of existing resources that were created in the REST API. This is required or the stack will be conflicted
200-
restApiResources:
200+
restApiResources:
201201
/users: xxxxxxxxxx
202202
203203
functions:
@@ -257,6 +257,21 @@ stepFunctions:
257257

258258
Configuring the cors property sets Access-Control-Allow-Origin, Access-Control-Allow-Headers, Access-Control-Allow-Methods,Access-Control-Allow-Credentials headers in the CORS preflight response.
259259

260+
To enable the Access-Control-Max-Age preflight response header, set the maxAge property in the cors object:
261+
262+
```yml
263+
stepFunctions:
264+
stateMachines:
265+
SfnApiGateway:
266+
events:
267+
- http:
268+
path: /playground/start
269+
method: post
270+
cors:
271+
origin: '*'
272+
maxAge: 86400
273+
```
274+
260275
#### Customizing request body mapping templates
261276

262277
The plugin generates default body mapping templates for `application/json` and `application/x-www-form-urlencoded` content types. If you'd like to add more content types or customize the default ones, you can do so by including them in `serverless.yml`:

0 commit comments

Comments
 (0)