lint :(
This commit is contained in:
parent
a220d59bf9
commit
78aa16cded
3 changed files with 6 additions and 6 deletions
|
@ -1,4 +1,4 @@
|
||||||
import { NextApiRequest, NextApiResponse } from "next";
|
import type { NextApiRequest, NextApiResponse } from "next";
|
||||||
import { createOpenApiNextHandler } from "trpc-openapi";
|
import { createOpenApiNextHandler } from "trpc-openapi";
|
||||||
import cors from "nextjs-cors";
|
import cors from "nextjs-cors";
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import { createTRPCContext } from "~/server/api/trpc";
|
||||||
|
|
||||||
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||||
// Setup CORS
|
// Setup CORS
|
||||||
cors(req, res);
|
await cors(req, res);
|
||||||
|
|
||||||
// Handle incoming OpenAPI requests
|
// Handle incoming OpenAPI requests
|
||||||
return createOpenApiNextHandler({
|
return createOpenApiNextHandler({
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { NextApiRequest, NextApiResponse } from 'next';
|
import type { NextApiRequest, NextApiResponse } from "next";
|
||||||
|
|
||||||
import { openApiDocument } from '../../server/openapi';
|
import { openApiDocument } from "../../server/openapi";
|
||||||
|
|
||||||
// Respond with our OpenAPI schema
|
// Respond with our OpenAPI schema
|
||||||
const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
const handler = (req: NextApiRequest, res: NextApiResponse) => {
|
||||||
res.status(200).send(openApiDocument);
|
res.status(200).send(openApiDocument);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default handler;
|
export default handler;
|
||||||
|
|
|
@ -67,7 +67,7 @@ export const createTRPCContext = async (opts: CreateNextContextOptions) => {
|
||||||
* This is where the tRPC API is initialized, connecting the context and transformer.
|
* This is where the tRPC API is initialized, connecting the context and transformer.
|
||||||
*/
|
*/
|
||||||
import { initTRPC, TRPCError } from "@trpc/server";
|
import { initTRPC, TRPCError } from "@trpc/server";
|
||||||
import { OpenApiMeta } from "trpc-openapi";
|
import type { OpenApiMeta } from "trpc-openapi";
|
||||||
import { Ratelimit } from "@upstash/ratelimit";
|
import { Ratelimit } from "@upstash/ratelimit";
|
||||||
import superjson from "superjson";
|
import superjson from "superjson";
|
||||||
import { env } from "~/env.mjs";
|
import { env } from "~/env.mjs";
|
||||||
|
|
Loading…
Add table
Reference in a new issue