9 lines
240 B
TypeScript
9 lines
240 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { getDb } from "@/lib/db";
|
|
|
|
export async function GET() {
|
|
const sql = getDb();
|
|
const rows = await sql(`SELECT * FROM categories ORDER BY name ASC`);
|
|
return NextResponse.json(rows);
|
|
}
|