使用網絡框架部署
Mastra 與網絡框架整合後,會使用該框架的標準部署流程,連同你的應用程式一併部署。請按照以下指示,確保 Mastra 整合能正確部署。
注意
如果你要部署至雲端 Provider,請從 Mastra 配置中移除所有 LibSQLStore 用法。LibSQLStore 需要存取檔案系統,因此與無伺服器平台不兼容。
整合指南:
在 Vercel 上配合 Next.js 使用在 Vercel 上配合 Next.js 使用 的直接連結
如果你已按照我們的指南將 Mastra 與 Next.js 整合,並計劃部署至 Vercel,請將 serverExternalPackages: ["@mastra/*"] 加入 next.config.ts:
next.config.ts
import type { NextConfig } from 'next'
const nextConfig: NextConfig = {
serverExternalPackages: ['@mastra/*'],
}
export default nextConfig
在 Vercel 上配合 Astro 使用在 Vercel 上配合 Astro 使用 的直接連結
如果你已按照我們的指南將 Mastra 與 Astro 整合,並計劃部署至 Vercel,請在 astro.config.mjs 中加入 Vercel adapter 和伺服器輸出:
astro.config.mjs
import { defineConfig } from 'astro/config'
import vercel from '@astrojs/vercel'
export default defineConfig({
adapter: vercel(),
output: 'server',
})
在 Netlify 上配合 Astro 使用在 Netlify 上配合 Astro 使用 的直接連結
如果你已按照我們的指南將 Mastra 與 Astro 整合,並計劃部署至 Netlify,請在 astro.config.mjs 中加入 Netlify adapter 和伺服器輸出:
astro.config.mjs
import { defineConfig } from 'astro/config'
import netlify from '@astrojs/netlify'
export default defineConfig({
adapter: netlify(),
output: 'server',
})