Next.js Discord

Discord Forum

revalidatePath not working for api route?

Unanswered
Eastern Bluebird posted this in #help-forum
Open in Discord
Eastern BluebirdOP
/api/blog/route.ts
export const dynamic = "force-static";

import { NextResponse } from "next/server";

export const GET = async () => {
  return NextResponse.json({
    message: "Blog API is working",
    time: new Date().toISOString(),
  });
};



revalidatePath("/api/blog")

why it not working? revalidatePath is not support api route?

1 Reply