test
Signed-off-by: Max Schmidt <max.schmidt@outlook.de>
This commit is contained in:
parent
21fe6de0ec
commit
75e0a0192d
@ -1,9 +1,8 @@
|
||||
import type { Post } from "../types";
|
||||
|
||||
const url =
|
||||
import.meta.env.NODE_ENV === "development"
|
||||
? "http://payload:3001"
|
||||
: `https://${import.meta.env.PAYLOAD_URL}`;
|
||||
const url = import.meta.env.DEV
|
||||
? "http://payload:3001"
|
||||
: `https://${import.meta.env.PAYLOAD_URL}`;
|
||||
|
||||
export const getPosts = async () =>
|
||||
(await (await fetch(`${url}/api/posts`)).json()).docs as Post[];
|
||||
|
@ -9,7 +9,7 @@
|
||||
"build:payload": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload build",
|
||||
"build:server": "tsc",
|
||||
"build": "yarn build:payload && yarn build:server",
|
||||
"serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.ts node dist/server.js",
|
||||
"serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js node dist/server.js",
|
||||
"generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types"
|
||||
},
|
||||
"dependencies": {
|
||||
|
Loading…
Reference in New Issue
Block a user