Log Request & Response
Capture the full request and response to send to your log provider.
Log Request & Response#
This sample shows how to add logging for every request that captures the full request and response in order to send to your log provider.
This example uses the OnResponseSendingFinal hook in the zuplo.runtime.ts
file to register a global log event.
Use this example locally#
To develop with this example locally, you can create a new Zuplo project using our CLI
npx create-zuplo-api@latest my-api --example log-request-response
Then, in the project directory run the following commands:
npm install
npm run dev
Discover More Examples
Remote MCP Server with OAuth
A remote MCP Server that shows how to setup OAuth authentication with Auth0
Dev Portal with API Keys
An example of a Zuplo Dev Portal with support for self-serve API key creation.
Remote MCP Server
Create a remote MCP server for an API with authentication and additional security policies.
Metering with OpenMeter
Meter requests, enforce plan limits and monetize your API by integrating Zuplo with OpenMeter.