WIP: Mock API for providers and start rendering data

This commit is contained in:
Pablo Lara committed 2024-07-26 18:01:50 +02:00
1 parent 1244cdb73e
commit 0ee60efaa7
6 files changed
+119 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
import { NextResponse } from "next/server";
import data from "../../../dataProviders.json";
export async function GET() {
// Simulate fetching data with a delay
await new Promise((resolve) => setTimeout(resolve, 2000));
return NextResponse.json({ providers: data });
}
+8
View File
@@ -0,0 +1,8 @@
import "server-only";
export default async function getProvider() {
const res = await fetch("http://localhost:3000/api/providers");
const product = await res.json();
return product;
}
+1
View File
@@ -0,0 +1 @@
export * from "./dataProvider";