diff --git a/.env.local b/.env.local index 5b97884..cff22b7 100644 --- a/.env.local +++ b/.env.local @@ -1,11 +1,13 @@ # Options -# VITE_OPTION=true +VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000 # API related -VITE_API_GRAPHQL_URL_DEV="http://api.housesof.localhost:8055/graphql" -VITE_API_GRAPHQL_URL_PROD="https://api.housesof.world/graphql" +# VITE_API_URL_DEV="http://192.168.1.19:8055/graphql" +VITE_API_URL_DEV="http://api.housesof.localhost:8055" +VITE_API_URL_PROD="https://api.housesof.world" +VITE_API_GRAPHQL_PATH="/graphql" VITE_API_TOKEN="efa40490-152c-49d7-a75b-30a6427439b1" # Analytics -VITE_ANALYTICS_KEY="" +VITE_ANALYTICS_KEY="c01e378821e6ba7bf9a9f947b107500bfcbd4ae8" VITE_ANALYTICS_URL="https://stats.flayks.com" \ No newline at end of file diff --git a/src/utils/api.ts b/src/utils/api.ts index 3f7234f..43c1ac1 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -1,4 +1,6 @@ -const apiURL: string = process.env.NODE_ENV === 'development' ? `${import.meta.env.VITE_API_GRAPHQL_URL_DEV}` : `${import.meta.env.VITE_API_GRAPHQL_URL_PROD}` +const apiURL: string = process.env.NODE_ENV === 'development' + ? `${import.meta.env.VITE_API_URL_DEV}` + : `${import.meta.env.VITE_API_URL_PROD}` /** @@ -6,7 +8,7 @@ const apiURL: string = process.env.NODE_ENV === 'development' ? `${import.meta.e */ export const fetchAPI = async (query: string) => { try { - const res = await fetch(apiURL, { + const res = await fetch(`${apiURL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, { method: 'POST', headers: { 'Content-Type': 'application/json',