From e61dd263c5975b607a7d6bf2e2a98cd4856417e7 Mon Sep 17 00:00:00 2001
From: Ategon <benjamin@barbeau.net>
Date: Wed, 15 Jan 2025 20:51:28 -0500
Subject: [PATCH] Add dev backend support

---
 src/components/posts/index.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/components/posts/index.tsx b/src/components/posts/index.tsx
index ed845b3..7763a44 100644
--- a/src/components/posts/index.tsx
+++ b/src/components/posts/index.tsx
@@ -9,7 +9,11 @@ export default function Posts() {
 
   useEffect(() => {
     const fetchPosts = async () => {
-      const response = await fetch("https://jam.edikoyo.com/api/v1/posts");
+      const response = await fetch(
+        process.env.MODE === "PROD"
+          ? "https://d2jam.com/api/v1/posts"
+          : "http://localhost:3005/api/v1/posts"
+      );
       setPosts(await response.json());
     };