Something went wrong. Try again.
A lexicon-driven AppView for ATProto.
Something went wrong. Try again.
TypeScript
12345678910111213141516171819202122232425262728293031323334import type { NextConfig } from "next";
const apiBase = process.env.API_URL || "http://localhost:3000";const basePath = process.env.NEXT_PUBLIC_BASE_PATH || undefined;
const nextConfig: NextConfig = { reactCompiler: true, trailingSlash: true, images: { unoptimized: true }, basePath,};
if (process.env.NODE_ENV === "production") { nextConfig.output = "export";} else { nextConfig.rewrites = async () => ({ // beforeFiles rewrites run before the trailingSlash redirect, // preventing 308s on API fetch calls. beforeFiles: [ { source: "/admin/:path*", destination: `${apiBase}/admin/:path*` }, { source: "/auth/:path*", destination: `${apiBase}/auth/:path*` }, { source: "/xrpc/:path*", destination: `${apiBase}/xrpc/:path*` }, { source: "/health", destination: `${apiBase}/health` }, { source: "/config", destination: `${apiBase}/config` }, { source: "/oauth/:path*", destination: `${apiBase}/oauth/:path*` }, { source: "/external-auth/:path*", destination: `${apiBase}/external-auth/:path*` }, ], afterFiles: [], fallback: [], });}
export default nextConfig;