# Function: extractServingEndpoints()

```ts
function extractServingEndpoints(serverFilePath: string): 
  | Record<string, EndpointConfig>
  | null;

```

Extract serving endpoint config from a server file by AST-parsing it. Looks for `serving({ endpoints: { alias: { env: "..." }, ... } })` calls and extracts the endpoint alias names and their environment variable mappings.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter        | Type     | Description                            |
| ---------------- | -------- | -------------------------------------- |
| `serverFilePath` | `string` | Absolute path to the server entry file |

## Returns[​](#returns "Direct link to Returns")

\| `Record`<`string`, [`EndpointConfig`](./docs/api/appkit/Interface.EndpointConfig.md)> | `null`

Extracted endpoint config, or null if not found or not extractable
