mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
19 lines
539 B
TypeScript
19 lines
539 B
TypeScript
import { notFound } from 'next/navigation'
|
|
import { type NextRequest, NextResponse } from 'next/server'
|
|
import { getLLMText } from '@/lib/llms'
|
|
import { source } from '@/lib/source'
|
|
|
|
export const revalidate = false
|
|
|
|
export async function GET(_req: NextRequest, { params }: { params: Promise<{ slug?: string[] }> }) {
|
|
const { slug } = await params
|
|
const page = source.getPage(slug)
|
|
if (!page) notFound()
|
|
|
|
return new NextResponse(await getLLMText(page))
|
|
}
|
|
|
|
export function generateStaticParams() {
|
|
return source.generateParams()
|
|
}
|