Files
kit-ui/app/api/fonts/route.ts
Sebastian Krüger 2000623c67 feat: implement Figlet, Pastel, and Unit tools with a unified layout
- Add Figlet text converter with font selection and history
- Add Pastel color palette generator and manipulation suite
- Add comprehensive Units converter with category-based logic
- Introduce AppShell with Sidebar and Header for navigation
- Modernize theme system with CSS variables and new animations
- Update project configuration and dependencies
2026-02-22 21:35:53 +01:00

30 lines
812 B
TypeScript

import { NextResponse } from 'next/server';
import fs from 'fs';
import path from 'path';
export const dynamic = 'force-static';
export async function GET() {
try {
const fontsDir = path.join(process.cwd(), 'public/fonts/figlet-fonts');
const files = fs.readdirSync(fontsDir);
const fonts = files
.filter(file => file.endsWith('.flf'))
.map(file => {
const name = file.replace('.flf', '');
return {
name,
fileName: file,
path: `/fonts/figlet-fonts/${file}`,
};
})
.sort((a, b) => a.name.localeCompare(b.name));
return NextResponse.json(fonts);
} catch (error) {
console.error('Error reading fonts directory:', error);
return NextResponse.json({ error: 'Failed to load fonts' }, { status: 500 });
}
}