fix(trpc): add openApiHandler to api route

This commit is contained in:
Mauricio Siu
2024-06-28 22:40:13 -06:00
parent b28bf5f9ec
commit 7e9e9dc865
3 changed files with 70 additions and 46 deletions

View File

@@ -248,7 +248,7 @@ export const settingsRouter = createTRPCRouter({
getOpenApiDocument: protectedProcedure.query(
async ({ ctx }): Promise<unknown> => {
const protocol = ctx.req.headers["x-forwarded-proto"];
const url = `${protocol}://${ctx.req.headers.host}/api/trpc`;
const url = `${protocol}://${ctx.req.headers.host}/api`;
const openApiDocument = generateOpenApiDocument(appRouter, {
title: "tRPC OpenAPI",
version: "1.0.0",