Shawn Mervin

API Gateway

AWS's managed API front door, and the live wire behind my build log.

Visit aws.amazon.com/api-gatewayAWS

What it is

Amazon API Gateway is a managed service for creating and running APIs on AWS. It handles REST and HTTP APIs that route requests to Lambda functions or other back ends, with authorization, throttling, request validation and separate stages for testing and production, so the code behind it only has to answer the request.

It also runs WebSocket APIs. A browser opens one long-lived connection, API Gateway keeps it open and calls a Lambda function when someone connects, disconnects or sends a message. To push data out, the back end posts to a connection by its ID through the management API, which lets a serverless system send live updates without running a socket server.

How I use it

  • Pages on the build log hold a WebSocket open to API Gateway.
  • Claude Code hooks on my machine send each agent event to a Lambda function, which pushes it to every open page.
  • Each event carries what happened, the tool's name, which product the work is in and a short session hash. No code, no file names, no prompts.
  • The WebSocket API, its routes and its stage are defined in the same CloudFormation template as the rest of the site.

API Gateway's WebSocket API is the right tool when a page needs updates pushed to it and there is no server to hold connections open. For REST, a Lambda function URL behind CloudFront is often simpler, so that is what most of this site uses. The build log needed a push, so it got a WebSocket.

Questions

Can you do real-time updates on a serverless site?

Yes. An API Gateway WebSocket API holds the connections and a Lambda function pushes messages to them, so there is no socket server to run.

What does the build log show?

Agents working right now, and a year of counts from git and the agents' own logs. Counts only, with no code or customer data.

Working with API Gateway?

Tell me what you're building. Start a project or see the whole stack.

Got an operation that's outgrown its spreadsheets?

Tell me what your business does and where it's jamming up. If I'm not the right person for it, I'll say so and point you somewhere better.

What to send, and what happens next