test
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
parent
5ca25e699a
commit
ec0e7601c4
@ -1,9 +1,9 @@
|
||||
import type { Post } from "../types";
|
||||
|
||||
const url =
|
||||
process.env.NODE_ENV === "development"
|
||||
import.meta.env.NODE_ENV === "development"
|
||||
? "http://payload:3001"
|
||||
: `https://${process.env.PAYLOAD_URL}`;
|
||||
: `https://${import.meta.env.PAYLOAD_URL}`;
|
||||
|
||||
export const getPosts = async () =>
|
||||
(await (await fetch(`${url}/api/posts`)).json()).docs as Post[];
|
||||
|
Loading…
Reference in New Issue
Block a user