Web 框架
当 Mastra 与 web 框架集成时,它会使用该框架的标准部署流程与你的应用一起部署。请遵循以下说明,确保你的 Mastra 集成正确部署。
注意
如果要部署到云提供器,请不要使用带本地 file: 或内存数据库的 LibSQLStore。本地数据库需要文件系统访问,与无服务器平台不兼容。请改为将 LibSQLStore 指向 Turso 等远程数据库。
集成指南:
在 Vercel 上使用 Next.js在 Vercel 上使用 Next.js的直接链接
如果你已按照我们的指南将 Mastra 与 Next.js 集成,并计划部署到 Vercel,请在 next.config.ts 中添加 serverExternalPackages: ["@mastra/*"]:
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 和 server output:
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 和 server output:
astro.config.mjs
import { defineConfig } from 'astro/config'
import netlify from '@astrojs/netlify'
export default defineConfig({
adapter: netlify(),
output: 'server',
})