mirror of
https://github.com/Ategon/Jamjar.git
synced 2025-02-12 06:16:21 +00:00
Add dev backend support
This commit is contained in:
parent
2c05a7464f
commit
e61dd263c5
1 changed files with 5 additions and 1 deletions
|
@ -9,7 +9,11 @@ export default function Posts() {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchPosts = async () => {
|
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());
|
setPosts(await response.json());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue