createGcfHandler

View as MarkdownOpen in Claude

Static method that creates a Google Cloud Functions-compatible handler from a Hono app. The returned function accepts GCF request/response objects.

Parameters

app
{ fetch: (req: Request) => Promise<Response> }Required

A Hono-compatible application with a fetch method.

Returns

(req: any, res: any) => Promise<void> — A GCF handler function.

Example

1import { ServerlessAdapter } from '@signalwire/sdk';
2
3// Export as Google Cloud Function
4export const handler = ServerlessAdapter.createGcfHandler(app);