You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/fastapi-response-streaming-zip/README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This example shows how to use Lambda Web Adapter to run a FastAPI application with response streaming via a Function URL.
4
4
5
-
###How does it work?
5
+
## How does it work?
6
6
7
7
We add Lambda Web Adapter layer to the function and configure wrapper script.
8
8
@@ -14,7 +14,7 @@ We add Lambda Web Adapter layer to the function and configure wrapper script.
14
14
15
15
To get more information of Wrapper script, please read Lambda documentation [here](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-modify.html#runtime-wrapper).
16
16
17
-
This is the resource for Lambda function. The function urls's invoke mode is configured as "RESPONSE_STREAM", and Lambda environment variable "AWS_LWA_INVOKE_MODE" is set to "response_stream".
17
+
This is the resource for Lambda function. The function urls's invoke mode is configured as "RESPONSE_STREAM", and Lambda environment variable "AWS_LWA_INVOKE_MODE" is set to "response_stream".
18
18
19
19
```yaml
20
20
FastAPIFunction:
@@ -36,17 +36,17 @@ This is the resource for Lambda function. The function urls's invoke mode is con
36
36
InvokeMode: RESPONSE_STREAM
37
37
```
38
38
39
-
### Build and Deploy
39
+
## Build and Deploy
40
40
41
41
Run the following commands to build and deploy the application to lambda.
42
42
43
43
```bash
44
44
sam build --use-container
45
45
sam deploy --guided
46
46
```
47
-
When the deployment completes, take note of FastAPI's Value. It is the API Gateway endpoint URL.
48
47
49
-
### Verify it works
48
+
When the deployment completes, take note of FastAPI's Value. It is the API Gateway endpoint URL.
50
49
51
-
Open FastAPI's URL in a browser, you should see "This is streaming from Lambda" streams back 10 times.
50
+
## Verify it works
52
51
52
+
Open FastAPI's URL in a browser, you should see "This is streaming from Lambda" streams back character by character.
0 commit comments