Files
netrunner-landing/next.config.ts
T
2026-07-02 23:13:24 +07:00

37 lines
1.4 KiB
TypeScript

// next.config.ts
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
formats: ["image/avif", "image/webp"],
remotePatterns: [{ protocol: "https", hostname: "netrunner-vpn.com" }],
},
async rewrites() {
return {
// beforeFiles: срабатывает до проверки файлов в /public — отдаёт статический
// doom.html по человекочитаемому пути /doom (пасхалка с браузерным DOOM).
beforeFiles: [
{
source: "/doom",
destination: "/doom.html",
},
],
// fallback: срабатывает только если ни один маршрут/файл Next.js не подошёл —
// проксирует запросы фронта на Rust-шлюз proxy-ws (гостевая книга, спидтест и т.д.),
// чтобы браузер обращался к тому же origin и не упирался в CORS. В контейнере
// прод-сборка резолвит ws-proxy по имени докер-сервиса, в деве — на localhost.
fallback: [
{
source: "/api/proxy/:path*",
destination:
process.env.NODE_ENV === "production"
? "http://ws-proxy:3001/:path*"
: "http://127.0.0.1:3001/:path*",
},
],
};
},
};
export default nextConfig;