Files
pse.dev/app/api/articles/route.ts
Kalidou Diagne f022fa21fb feat: add blog post feed to project pages #368 (#369)
- [x] Add blog post feed to project pages #368
- [x] update readme
- [x] fix blog tags
2025-05-01 13:59:04 +02:00

20 lines
523 B
TypeScript

import { NextResponse } from "next/server"
import { getArticles } from "@/lib/blog"
export async function GET(request: Request) {
const { searchParams } = new URL(request.url)
const project = searchParams.get("project")
const limit = searchParams.get("limit")
? parseInt(searchParams.get("limit") || "100")
: undefined
const tag = searchParams.get("tag") || undefined
const articles = getArticles({
project: project || undefined,
limit,
tag,
})
return NextResponse.json({ articles })
}