forked from Goutam/lynkeduppro-crm
feat(landing): port the full marketing site into the CRM (static)
Copies the goutam-pages landing (React marketing home + /page/1..19 + assets) into /public and adds beforeFiles rewrites so '/' serves the marketing home and '/1'..'/19' + '/thanks' serve the static pages — reproducing the landing's vercel.json clean URLs. /portal/* (login/register) is untouched.
This commit is contained in:
+24
-4
@@ -1,14 +1,34 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
// The marketing landing is served as static files from /public (ported verbatim
|
||||
// from lynkeduppro-landing). These rewrites reproduce the landing's vercel.json
|
||||
// clean-URL routing: "/" is the React marketing home, "/1".."/19" are the static
|
||||
// pages under /public/page. `beforeFiles` lets them override the app router's "/"
|
||||
// (which otherwise redirects to /portal/login).
|
||||
const landingRewrites: { source: string; destination: string }[] = [
|
||||
{ source: "/", destination: "/index.html" },
|
||||
{ source: "/thanks", destination: "/thanks.html" },
|
||||
{ source: "/1", destination: "/page/index.html" },
|
||||
// "/2".."/19" -> /public/page/<n>.html
|
||||
...Array.from({ length: 18 }, (_, i) => i + 2).map((n) => ({
|
||||
source: `/${n}`,
|
||||
destination: `/page/${n}.html`,
|
||||
})),
|
||||
];
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// The SDK ships ESM/TS; let Next transpile it.
|
||||
transpilePackages: ["@abe-kap/appshell-sdk"],
|
||||
// The browser calls the Shell BFF same-origin under /shell (so the HttpOnly
|
||||
// session cookie flows). We deliberately use /shell (NOT /api) to avoid
|
||||
// clobbering the existing /api/geo route. Point BFF_ORIGIN at the deployed BFF.
|
||||
async rewrites() {
|
||||
// The browser calls the Shell BFF same-origin under /shell (so the HttpOnly
|
||||
// session cookie flows). We deliberately use /shell (NOT /api) to avoid
|
||||
// clobbering the /api/* route handlers (geo, and the founder checkout).
|
||||
const bff = process.env.BFF_ORIGIN ?? "http://localhost:4000";
|
||||
return [{ source: "/shell/:path*", destination: `${bff}/api/:path*` }];
|
||||
return {
|
||||
beforeFiles: landingRewrites,
|
||||
afterFiles: [{ source: "/shell/:path*", destination: `${bff}/api/:path*` }],
|
||||
fallback: [],
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user