Skip to content

Commit

Permalink
Merge pull request #17 from mooxl/dev
Browse files Browse the repository at this point in the history
test
  • Loading branch information
mooxl committed May 17, 2023
2 parents 490753c + 75e0a01 commit fb98219
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions astro/src/utils/payload.ts
Original file line number Diff line number Diff line change
@@ -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[];
Expand Down
2 changes: 1 addition & 1 deletion payload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit fb98219

Please sign in to comment.