This commit is contained in:
2026-02-11 22:30:04 +09:00
parent be1f627457
commit 30835f78d4
75 changed files with 4878 additions and 143 deletions

22
src/pages/api/home.ts Normal file
View File

@@ -0,0 +1,22 @@
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import { connection } from "@/lib/duckdb";
import type { NextApiRequest, NextApiResponse } from "next";
// Gets the page that is set as home page
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const result = await connection.run(`
SELECT p.*
FROM wp_posts p
WHERE p.ID = (
SELECT option_value
FROM wp_options
WHERE option_name = 'page_on_front'
LIMIT 1
)
LIMIT 1;`)
const rows = await result.getRowObjectsJson()
res.status(200).json(rows);
}