@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
22 lines (13 loc) • 652 B
Markdown
# Mastra.getServer()
The `.getServer()` method is used to retrieve the server configuration that has been configured in the Mastra instance.
## Usage example
```typescript
mastra.getServer()
```
## Parameters
This method doesn't accept any parameters.
## Returns
**server** (`ServerConfig | undefined`): The configured server configuration including port, host, studioBase, timeout, API routes, middleware, CORS settings, and build options, or undefined if no server has been configured.
## Related
- [Server deployment](https://mastra.ai/docs/deployment/mastra-server)
- [Server configuration](https://mastra.ai/docs/server/custom-api-routes)