fp/services/next/app/api/blogs/route.ts

11 lines
239 B
TypeScript
Raw Normal View History

2024-01-20 16:16:14 +00:00
import { NextResponse } from 'next/server'
export async function GET() {
const res = await fetch('https://dummyjson.com/posts', {
next: { revalidate: 60 },
});
const data = await res.json();
return NextResponse.json(data);
}