使用 Web 框架进行部署
🌐 Deploy with a Web Framework
当 Mastra 与 web 框架集成时,它会随应用一起使用框架的标准部署流程进行部署。请按照以下说明操作,以确保 Mastra 集成能够正确部署。
🌐 When Mastra is integrated with a web framework, it deploys alongside your application using the framework's standard deployment process. Follow the instructions below to ensure your Mastra integration deploys correctly.
如果你正在部署到云提供商,请从你的 Mastra 配置中移除所有对 LibSQLStore 的使用。LibSQLStore 需要文件系统访问,因此与无服务器平台不兼容。
集成指南:
🌐 Integration guides:
在 Vercel 上使用 Next.jsDirect link to 在 Vercel 上使用 Next.js
🌐 With Next.js on Vercel
如果你已经按照我们的指南将 Mastra 与 Next.js 集成,并计划部署到 Vercel,请将 serverExternalPackages: ["@mastra/*"] 添加到你的 next.config.ts :
🌐 If you've integrated Mastra with Next.js by following our guide and plan to deploy to Vercel, add serverExternalPackages: ["@mastra/*"] to your next.config.ts:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
serverExternalPackages: ["@mastra/*"],
};
export default nextConfig;
在 Vercel 上使用 AstroDirect link to 在 Vercel 上使用 Astro
🌐 With Astro on Vercel
如果你已经按照我们的指南 将 Mastra 与 Astro 集成 并计划部署到 Vercel,请将 Vercel 适配器和服务器输出添加到你的 astro.config.mjs:
🌐 If you've integrated Mastra with Astro by following our guide and plan to deploy to Vercel, add the Vercel adapter and server output to your astro.config.mjs:
import { defineConfig } from "astro/config";
import vercel from "@astrojs/vercel";
export default defineConfig({
adapter: vercel(),
output: "server",
});
在 Netlify 上使用 AstroDirect link to 在 Netlify 上使用 Astro
🌐 With Astro on Netlify
如果你已经按照我们的指南将 Mastra 与 Astro 集成,并计划部署到 Netlify,请在你的 astro.config.mjs 中添加 Netlify 适配器和服务器输出:
🌐 If you've integrated Mastra with Astro by following our guide and plan to deploy to Netlify, add the Netlify adapter and server output to your astro.config.mjs:
import { defineConfig } from "astro/config";
import netlify from "@astrojs/netlify";
export default defineConfig({
adapter: netlify(),
output: "server",
});