Update config

This commit is contained in:
2021-09-24 11:03:38 +02:00
parent 1dbadd5bbe
commit ac538692b9
2 changed files with 10 additions and 6 deletions

View File

@@ -1,11 +1,13 @@
# Options # Options
# VITE_OPTION=true VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000
# API related # API related
VITE_API_GRAPHQL_URL_DEV="http://api.housesof.localhost:8055/graphql" # VITE_API_URL_DEV="http://192.168.1.19:8055/graphql"
VITE_API_GRAPHQL_URL_PROD="https://api.housesof.world/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" VITE_API_TOKEN="efa40490-152c-49d7-a75b-30a6427439b1"
# Analytics # Analytics
VITE_ANALYTICS_KEY="" VITE_ANALYTICS_KEY="c01e378821e6ba7bf9a9f947b107500bfcbd4ae8"
VITE_ANALYTICS_URL="https://stats.flayks.com" VITE_ANALYTICS_URL="https://stats.flayks.com"

View File

@@ -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) => { export const fetchAPI = async (query: string) => {
try { try {
const res = await fetch(apiURL, { const res = await fetch(`${apiURL}${import.meta.env.VITE_API_GRAPHQL_PATH}`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',