mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-14 08:38:02 -05:00
20 lines
523 B
TypeScript
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 })
|
|
}
|