mirror of
https://github.com/vercel/next-learn.git
synced 2026-06-11 09:51:47 +00:00
* add example query * prettier-fix --------- Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
27 lines
675 B
TypeScript
27 lines
675 B
TypeScript
// import { db } from "@vercel/postgres";
|
|
|
|
// const client = await db.connect();
|
|
|
|
// async function listInvoices() {
|
|
// const data = await client.sql`
|
|
// SELECT invoices.amount, customers.name
|
|
// FROM invoices
|
|
// JOIN customers ON invoices.customer_id = customers.id
|
|
// WHERE invoices.amount = 666;
|
|
// `;
|
|
|
|
// return data.rows;
|
|
// }
|
|
|
|
export async function GET() {
|
|
return Response.json({
|
|
message:
|
|
'Uncomment this file and remove this line. You can delete this file when you are finished.',
|
|
});
|
|
// try {
|
|
// return Response.json(await listInvoices());
|
|
// } catch (error) {
|
|
// return Response.json({ error }, { status: 500 });
|
|
// }
|
|
}
|