Skip to content

Commit

Permalink
feat(web/server): use edge runtime for trpc and document download end…
Browse files Browse the repository at this point in the history
…point
  • Loading branch information
mrevanzak committed May 27, 2024
1 parent 4f776b5 commit 85fbc0f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/web/src/app/api/documents/[fileId]/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { env } from "@/env";
import { auth } from "@/server/auth";

export const runtime = "edge";

export async function GET(_: Request, context: { params: { fileId: string } }) {
const session = await auth();
if (session?.user.role !== "admin") {
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/app/api/trpc/[trpc]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { appRouter } from "@/server/api/root";
import { createTRPCContext } from "@/server/api/trpc";
import { fetchRequestHandler } from "@trpc/server/adapters/fetch";

export const runtime = "edge";

/**
* This wraps the `createTRPCContext` helper and provides the required context for the tRPC API when
* handling a HTTP request (e.g. when you make requests from Client Components).
Expand Down

0 comments on commit 85fbc0f

Please sign in to comment.