# Serve
Source: https://www.inngest.com/docs/reference/serve/index

The `serve()` API handler is used to serve your application's [functions](/docs/reference/functions/create) via HTTP. This handler enables Inngest to remotely and securely read your functions' configuration and invoke your function code. This enables you to host your function code on any platform.

<CodeGroup>
```ts {{ title: "v3" }}
// or your preferred framework
import {
  importProductImages,
  sendSignupEmail,
  summarizeText,
} from "./functions";

serve({
  client: inngest,
  functions: [sendSignupEmail, summarizeText, importProductImages],
});
```
```ts {{ title: "v2" }}
// or your preferred framework
import {
  importProductImages,
  sendSignupEmail,
  summarizeText,
} from "./functions";

serve(inngest, [sendSignupEmail, summarizeText, importProductImages]);
```
</CodeGroup>

`serve` handlers are imported from convenient framework-specific packages like `"inngest/next"`, `"inngest/express"`, or `"inngest/lambda"`. [Click here for a full list of officially supported frameworks](/docs/learn/serving-inngest-functions). For any framework that is not support, you can [create a custom handler](#custom-frameworks).

---

## `serve(options)`

<Properties>
  <Property name="client" type="Inngest client" required>
    An Inngest client ([reference](/docs/reference/client/create)).
  </Property>
  <Property name="functions" type="InngestFunctions[]" required>
    An array of Inngest functions defined using `inngest.createFunction()` ([reference](/docs/reference/functions/create)).
  </Property>
  <Property name="signingKey" type="string" required>
    The Inngest [Signing Key](/docs/platform/signing-keys) for your [selected environment](/docs/platform/environments). We recommend setting the [`INNGEST_SIGNING_KEY`](/docs/sdk/environment-variables#inngest-signing-key) environment variable instead of passing the `signingKey` option. You can find this in [the Inngest dashboard](https://app.inngest.com/env/production/manage/signing-key).
  </Property>
  <Property name="serveHost" type="string">
    The domain host of your application, _including_ protocol, e.g. `https://myapp.com`. The SDK attempts to infer this via HTTP headers at runtime, but this may be required when using platforms like AWS Lambda or when using a reverse proxy. See also [`INNGEST_SERVE_HOST`](/docs/sdk/environment-variables#inngest-serve-host).
  </Property>
  <Property name="servePath" type="string">
    The path where your `serve` handler is hosted. The SDK attempts to infer this via HTTP headers at runtime. We recommend `/api/inngest`. See also [`INNGEST_SERVE_PATH`](/docs/sdk/environment-variables#inngest-serve-path).
  </Property>
  <Property name="streaming" type={`"allow" | "force" | false`}>
    Enables streaming responses back to Inngest which can enable maximum serverless function timeouts. See [reference](/docs/streaming) for more information on the configuration.  See also [`INNGEST_SERVE_HOST`](/docs/sdk/environment-variables#inngest-serve-host).
  </Property>
  <Property name="logLevel" type={`"fatal" | "error" | "warn" | "info" | "debug" | "silent"`}>
    The minimum level to log from the Inngest serve endpoint. Defaults to `"info"`. See also [`INNGEST_LOG_LEVEL`](/docs/sdk/environment-variables#inngest-log-level).
  </Property>
  <Property name="baseUrl" type="string">
    The URL used to communicate with Inngest. This can be useful in testing environments when using the Inngest Dev Server. Defaults to: `"https://api.inngest.com/"`. See also [`INNGEST_BASE_URL`](/docs/sdk/environment-variables#inngest-base-url).
  </Property>
  <Property name="fetch" type="Fetch API compatible interface">
    Override the default [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) implementation. Defaults to the runtime's native Fetch API.
  </Property>
  <Property name="id" type="string">
    The ID to use to represent this application instead of the client's ID. Useful for creating many Inngest endpoints in a single application.
  </Property>
</Properties>

<Callout>
  We always recommend setting the [`INNGEST_SIGNING_KEY`](/docs/sdk/environment-variables#inngest-signing-key) over using the `signingKey` option. As with any secret, it's not a good practice to hard-code the signing key in your codebase.
</Callout>

## How the `serve` API handler works

The API works by exposing a single endpoint at `/api/inngest` which handles different actions utilizing HTTP request methods:

- `GET`: Return function metadata and render a debug page in in **development only**. See [`landingPage`](#landingPage).
- `POST`: Invoke functions with the request body as incoming function state.
- `PUT`: Trigger the SDK to register all functions with Inngest using the signing key.