| 12 | const languages = ['en', 'fr', 'es', 'de', 'zh', 'ru', 'hi']; |
| 13 | |
| 14 | const readAlgorithmRoutes = async () => { |
| 15 | try { |
| 16 | const slugPath = path.resolve(__dirname, '..', 'src', 'data', 'algorithm-slugs.json'); |
| 17 | const raw = await fs.readFile(slugPath, 'utf8'); |
| 18 | const parsed = JSON.parse(raw); |
| 19 | const slugs = Object.values(parsed).filter((v) => typeof v === 'string'); |
| 20 | return slugs.map((slug) => `/Education/Algorithms/${slug}`); |
| 21 | } catch { |
| 22 | return []; |
| 23 | } |
| 24 | }; |
| 25 | |
| 26 | const staticBaseRoutes = ['/', '/Dithering/Image', '/Dithering/Video', '/Education', '/Education/Basics', '/Education/Practice', '/Education/Algorithms']; |
| 27 | let algorithmRoutes = []; |