Files
2026-09-05 12:31:25 +05:30

61 lines
2.8 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const srcAppDir = path.join(__dirname, 'src', 'app');
const routes = {
// Home
'page.tsx': `export { default } from "./HomePage/Index";`,
// Pricing
'pricing/page.tsx': `export { default } from "../Pricing/index";`,
// Contact
'contact/page.tsx': `export { default } from "../ContactPage/MainContactPage";`,
'contact-us/page.tsx': `export { default } from "../ContactPage/MainContactPage";`,
'demo/page.tsx': `export { default } from "../ContactPage/MainContactPage";`,
'book-a-demo/page.tsx': `export { default } from "../ContactPage/MainContactPage";`,
// Security
'security/page.tsx': `export { default } from "../SecurityPage/Index";`,
// Blog / Resources
'blog/page.tsx': `export { default } from "../ResourcePage/BlogPage";`,
'resources/page.tsx': `export { default } from "../ResourcePage/BlogPage";`,
'resources/blog/page.tsx': `export { default } from "../../ResourcePage/BlogPage";`,
'blog/[slug]/page.tsx': `export { default } from "../../ResourcePage/BlogDetailPage";`,
// Products
'product/platform/page.tsx': `export { default } from "../../ProductPage/AllProductsPage";`,
'product/drive/page.tsx': `export { default } from "../../ProductPage/DrivePage";`,
'product/pdf-editor/page.tsx': `export { default } from "../../ProductPage/PdfEditorPage";`,
'product/workflows/page.tsx': `export { default } from "../../ProductPage/WorkflowsPage";`,
'product/sign/page.tsx': `export { default } from "../../ProductPage/SignPage";`,
'product/free-pdf-tools/page.tsx': `export { default } from "../../ProductPage/AllPdfToolsPage";`,
'product/free-editor/page.tsx': `export { default } from "../../ProductPage/FreeEditorPages";`,
'product/embed/page.tsx': `export { default } from "../../ProductPage/EmbedPage";`,
// Solutions
'solutions/page.tsx': `export { default } from "../SolutionPage/AllSolutionsPage";`,
'solutions/enterprise/page.tsx': `export { default } from "../../SolutionPage/EnterPrisePage";`,
'solutions/legal/page.tsx': `export { default } from "../../SolutionPage/LegalPage";`,
'solutions/real-estate/page.tsx': `export { default } from "../../SolutionPage/RealEstatePage";`,
'solutions/operations/page.tsx': `export { default } from "../../SolutionPage/OperationsPage";`,
};
for (const [routePath, content] of Object.entries(routes)) {
const fullPath = path.join(srcAppDir, routePath);
const dir = path.dirname(fullPath);
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
// Next.js components that re-export need "use client" if the underlying component uses hooks,
// but it's cleaner to just do standard re-exports if they are client components.
// We'll write the content directly.
fs.writeFileSync(fullPath, content, 'utf8');
}
console.log('Routes setup completed.');