Remove unused TRPC panel code and simplify API handler response
This commit is contained in:
parent
5789007b9b
commit
cb6e0cee40
2 changed files with 15 additions and 13 deletions
|
|
@ -91,7 +91,6 @@
|
|||
"tailwind-merge": "3.3",
|
||||
"tailwind-scrollbar": "^4.0.2",
|
||||
"tailwindcss": "^4.1.11",
|
||||
"trpc-ui": "https://gitpkg.vercel.app/jrhe/trpc-ui/packages/trpc-ui?feature/zod-v4-support&scripts.postinstall=%26%26%20npm%20install%20pnpm%20%26%26%20npm%20install%20--ignore-scripts%20%26%26%20npm%20run%20build",
|
||||
"tw-animate-css": "^1.3.6",
|
||||
"type-fest": "^4.41.0",
|
||||
"uuid": "^11.1.0",
|
||||
|
|
|
|||
|
|
@ -1,16 +1,19 @@
|
|||
import type { NextApiRequest, NextApiResponse } from "next";
|
||||
import { renderTrpcPanel } from "trpc-ui";
|
||||
import { env } from "~/env.mjs";
|
||||
import { appRouter } from "~/server/api/root";
|
||||
// import { renderTrpcPanel } from "trpc-ui";
|
||||
// import { env } from "~/env.mjs";
|
||||
// import { appRouter } from "~/server/api/root";
|
||||
|
||||
// export default async function handler(_: NextApiRequest, res: NextApiResponse) {
|
||||
// if (!env.NEXT_PUBLIC_BASE_URL.includes("localhost")) {
|
||||
// return res.status(404).send("Not Found");
|
||||
// }
|
||||
// res.status(200).send(
|
||||
// renderTrpcPanel(appRouter, {
|
||||
// url: `${env.NEXT_PUBLIC_BASE_URL}/api/trpc`,
|
||||
// transformer: "superjson",
|
||||
// }),
|
||||
// );
|
||||
// }
|
||||
export default async function handler(_: NextApiRequest, res: NextApiResponse) {
|
||||
if (!env.NEXT_PUBLIC_BASE_URL.includes("localhost")) {
|
||||
return res.status(404).send("Not Found");
|
||||
}
|
||||
res.status(200).send(
|
||||
renderTrpcPanel(appRouter, {
|
||||
url: `${env.NEXT_PUBLIC_BASE_URL}/api/trpc`,
|
||||
transformer: "superjson",
|
||||
}),
|
||||
);
|
||||
res.status(404).send("Not Found");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue