
Stream live metrics to the browser over server-sent events (SSE) from a zero-dependency Node.js HTTP server running as an AWS Lambda Web Function.
AWS_LAMBDA_HTTP_ENDPOINT environment variable, and the server listens on it as it would anywhere else. Because the process stays alive between requests, it can hold long-lived connections open and push data to the client, which the Lambda event model cannot do.MultiRegion endpoint to get one global URL that uses Amazon Route 53 latency-based routing to serve each request from the nearest Region.This pattern is available in the following frameworks/languages:
git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-web-sse-dashboard/nodejs/samSee the GitHub repo for deployment instructions.sam delete --stack-name lambda-web-sse-dashboard-sam.