revalidatePath not working for api route?
Unanswered
Eastern Bluebird posted this in #help-forum
Eastern BluebirdOP
/api/blog/route.ts
revalidatePath("/api/blog")
why it not working? revalidatePath is not support api route?
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
@Eastern Bluebird /api/blog/route.ts
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?
It should do that, can you send your nextjs version, and more parts of your code