Stone.js API
    Preparing search index...

    Azure Functions v4 HTTP adapter for Stone.js.

    Azure Functions v4 invokes an HTTP-triggered function with a Web-standard HttpRequest and expects an HttpResponseInit back. Unlike a server adapter, run() does not start a listener — it returns the handler (request, invocationContext) => Promise<HttpResponseInit> that you register with app.http('name', { handler }) from @azure/functions.

    Because the request is Web-standard, the normalizer is the same one the Fetch adapter uses; only the raw response differs (an HttpResponseInit object rather than a Response).

    import { app } from '@azure/functions'
    const handler = await AzureFunctionsHttpAdapter.create(blueprint).run<AzureFunctionsHttpEventHandlerFunction>()
    app.http('stone', { methods: ['GET', 'POST'], authLevel: 'anonymous', handler })

    Hierarchy

    Index
    • Create an Adapter.

      Parameters

      • blueprint: IBlueprint

        The blueprint to create the adapter.

      Returns AzureFunctionsHttpAdapter

    blueprint: IBlueprint
    middleware: AdapterMixedPipeType<
        AzureFunctionsHttpAdapterContext,
        AzureHttpResponseInit,
    >[]
    resolvedErrorHandlers: Record<
        string,
        IAdapterErrorHandler<RawEventType, RawResponseType, ExecutionContextType>,
    >
    • Build the raw response.

      Parameters

      • context: AzureFunctionsHttpAdapterContext

        The event context.

      • OptionaleventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

        The event handler to be run.

      Returns Promise<AzureHttpResponseInit>

      The raw response wrapper.

    • Execute the event handler lifecycle hooks.

      Parameters

      • hook: KernelHookName

        The hook to execute.

      • eventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

        The event handler to be run.

      Returns Promise<void>

    • Execute adapter lifecycle hooks.

      Parameters

      Returns Promise<void>

    • Handle the event.

      Parameters

      • context: AzureFunctionsHttpAdapterContext

        The event context.

      • eventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

        The event handler to be run.

      Returns Promise<
          IAdapterEventBuilder<
              RawResponseOptions,
              IRawResponseWrapper<AzureHttpResponseInit>,
          >,
      >

      The raw response wrapper.

    • Lifecycle hook run once before the first request.

      Returns Promise<void>

    • Get the event handler for the adapter.

      Returns AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

      The event handler for the adapter.

      If the event handler is missing.

    • Send the raw event through the destination.

      Parameters

      • context: AzureFunctionsHttpAdapterContext

        The event context.

      • eventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

        The event handler to be run.

      Returns Promise<AzureHttpResponseInit>

      Platform-specific response.

      IntegrationError

    • Validate the context and event handler.

      Parameters

      • context: AzureFunctionsHttpAdapterContext

        The context to validate.

      • eventHandler: AdapterEventHandlerType<IncomingHttpEvent, OutgoingHttpResponse>

        The event handler to validate.

      Returns void

      IntegrationError