> Discover all available pages from the documentation index: https://mastra.zisheng.pro/zh-HK/llms.txt # Mastra.getServer() `.getServer()` 方法用於擷取 Mastra 實例中已設定的伺服器設定。 ## 使用範例 ```typescript mastra.getServer() ``` ## 參數 此方法不接受任何參數。 ## 傳回值 **server** (`ServerConfig | undefined`): 已設定的伺服器設定,包括連接埠、主機、studioBase、逾時、API 路由、中介軟件、CORS 設定及建置選項;如未設定伺服器,則為 undefined。 ## 相關內容 - [伺服器部署](https://mastra.zisheng.pro/zh-HK/docs/deployment/mastra-server) - [伺服器設定](https://mastra.zisheng.pro/zh-HK/docs/server/custom-api-routes)