Skip to content

Commit

Permalink
enable edge on api routes
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Dec 16, 2024
1 parent 3d273f5 commit ee318c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/api/auth/callback/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { REDIRECT_TO_COOKIE, TOKEN_COOKIE } from "@/utils/constants.ts";
import { makeApiRequest } from "@/utils/make-api-request.ts";
import { type NextRequest, NextResponse } from "next/server";

export const runtime = "edge";

export async function GET(request: NextRequest) {
if (!request.nextUrl.searchParams.has("code")) {
return Response.json({ message: "Missing code parameter" }, { status: 400 });
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/auth/logout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { TOKEN_COOKIE } from "@/utils/constants.ts";
import { revalidateTag } from "next/cache";
import { type NextRequest, NextResponse } from "next/server";

export const runtime = "edge";

export function GET(request: NextRequest) {
const redirectUrl = new URL("/", request.url);

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/guilds/[guildId]/export-levels/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { isSnowflake } from "@/utils/is-snowflake.ts";
import { makeApiRequest } from "@/utils/make-api-request.ts";
import type { NextRequest } from "next/server";

export const runtime = "edge";

export async function GET(request: NextRequest, { params }: { params: Promise<{ guildId: string }> }) {
const { guildId } = await params;

Expand Down

0 comments on commit ee318c3

Please sign in to comment.