@@ -1,2 +1,3 @@
|
||||
export const API_HOST = 'http://0.0.0.0:4000';
|
||||
export const API_PATH = '/api';
|
||||
export const API_HOST = process.env.API_HOST;
|
||||
export const API_ORIGIN = process.env.API_ORIGIN;
|
||||
export const API_PATH = process.env.API_PATH;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API_HOST, API_PATH } from './_entrypoint';
|
||||
import { API_ORIGIN, API_PATH } from './_entrypoint';
|
||||
|
||||
const jsonLdMimeType = 'application/json';
|
||||
|
||||
@@ -19,7 +19,7 @@ export default function eventFetch(url, store, optionsarg = {}) {
|
||||
options.headers.set('Authorization', `Bearer ${localStorage.getItem('token')}`);
|
||||
}
|
||||
|
||||
const link = url.includes(API_PATH) ? API_HOST + url : API_HOST + API_PATH + url;
|
||||
const link = url.includes(API_PATH) ? API_ORIGIN + url : API_ORIGIN + API_PATH + url;
|
||||
|
||||
return fetch(link, options).then((response) => {
|
||||
if (response.ok) return response;
|
||||
|
||||
Reference in New Issue
Block a user