Skip to content

Commit 70d072e

Browse files
committed
Add doc
1 parent d2db711 commit 70d072e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/events/http-api.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ resources:
380380
- Ref: YourCognitoUserPoolName
381381
```
382382

383-
### Event / payload format
383+
## Event / payload format
384384

385385
HTTP API offers only a 'proxy' option for Lambda integration where an event submitted to the function contains the details of HTTP request such as headers, query string parameters etc.
386386
There are two formats for this event available (see [Working with AWS Lambda proxy integrations for HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html)), with the default being 2.0. It is possible to downgrade to 1.0 version by specifying `payload`. The payload version could be configured globally as:
@@ -405,7 +405,7 @@ functions:
405405
method: GET
406406
```
407407

408-
### Detailed Metrics
408+
## Detailed Metrics
409409

410410
With HTTP API we may configure detailed metrics that can be used setup monitoring and alerting in Cloudwatch.
411411

@@ -417,7 +417,7 @@ provider:
417417
metrics: true
418418
```
419419

420-
### Tags
420+
## Tags
421421

422422
When using HTTP API, it is possible to tag the corresponding API Gateway resources. By setting `provider.httpApi.useProviderTags` to `true`, all tags defined on `provider.tags` will be applied to API Gateway and API Gateway Stage.
423423

@@ -433,7 +433,7 @@ In the above example, the tag project: myProject will be applied to API Gateway
433433

434434
_Note: If the API Gateway has any existing tags applied outside of Serverless Framework, they will be removed during deployment._
435435

436-
### Disable Default Endpoint
436+
## Disable Default Endpoint
437437

438438
By default, clients can invoke your API with the default https://{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
439439

@@ -443,14 +443,18 @@ provider:
443443
disableDefaultEndpoint: true
444444
```
445445

446-
### Service Naming
446+
## Service Naming
447447

448448
You can use the `shouldStartNameWithService` option to change the naming scheme for HTTP API from the default `${stage}-${service}` to `${service}-${stage}`.
449449

450+
You can also define your own name for the API instead of the default generated one and also define a description for it.
451+
450452
```yml
451453
provider:
452454
httpApi:
453455
shouldStartNameWithService: true
456+
name: app-dev-testApi
457+
description: My TestApi
454458
```
455459

456460
## Custom domains

0 commit comments

Comments
 (0)