const apiTarget = process.env.API_PROXY_TARGET || "http://127.0.0.1:8001"; const devApiRewrites = [ "/process_monitor", "/server_info", "/health", "/status", "/start", "/stop", "/restart", "/get_config", "/save_config", "/get_url_config", "/save_url_config", "/service_action", "/managed_roots", "/managed_files", "/managed_file", "/hardware_profile", "/system_snapshot", "/youtube_pro_channels", "/stack/:path*", "/deploy/:path*", "/android/:path*", "/hub/:path*", "/tiktok_replay/:path*", "/shellcrash/apply_profile", "/shellcrash/web_panel", ].map((source) => ({ source, destination: `${apiTarget}${source}`, })); /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", images: { unoptimized: true }, trailingSlash: false, }; if (process.env.NODE_ENV === "development") { nextConfig.rewrites = async () => { return { beforeFiles: [], afterFiles: devApiRewrites, fallback: [], }; }; } export default nextConfig;