What problem does it solve?
Exposing a custom HTTP endpoint (webhook, REST callback, health check) on a Webiny API normally requires touching Fastify, API Gateway, and Pulumi by hand. This Skill shows how to register a custom route with full dependency injection using a single declarative component.
Core Features & Use Cases
- Custom HTTP Endpoints: Implement
Route.Interface and register it with <Api.Route> in webiny.config.tsx to expose GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS, or ANY routes on API Gateway.
- Full Dependency Injection: Handlers are resolved from the DI container per request, so Logger, BuildParams, and UseCases are injected via the constructor automatically.
- Framework-Agnostic Request/Reply: Work with
Route.Request and Route.Reply abstractions without Fastify types leaking into your code.
- Use Case: Add a
POST /webhooks/stripe endpoint that receives Stripe events, logs them via the injected Logger, reads config through BuildParams, and returns a 200 response.
Quick Start
Add a custom POST route at /my-route to my Webiny API that logs the request and returns a JSON response.