Add AI company research workbench backed by the shared site database
Verify and deploy Tabularium / verify-and-deploy (pull_request) Failing after 5m57s
Verify and deploy Tabularium / verify-and-deploy (pull_request) Failing after 5m57s
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { readResearchSnapshot } from "@/lib/ai-research-store";
|
||||
|
||||
// The site's existing proxy protects this endpoint with the same login session.
|
||||
export default function handler(request: NextApiRequest, response: NextApiResponse) {
|
||||
response.setHeader("Cache-Control", "private, no-store");
|
||||
if (request.method !== "GET") {
|
||||
response.setHeader("Allow", "GET");
|
||||
return response.status(405).end();
|
||||
}
|
||||
try { return response.status(200).json(readResearchSnapshot()); }
|
||||
catch { return response.status(503).json({ error: "研究数据库暂时不可用,请稍后重试" }); }
|
||||
}
|
||||
Reference in New Issue
Block a user