make change that could possibly make the app work on a different subdomain than the api
This commit is contained in:
parent
e229afe026
commit
9ee72f7d9e
1 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,14 @@ async function APIRequest(endpoint, options) {
|
||||||
let isOK = false;
|
let isOK = false;
|
||||||
let err;
|
let err;
|
||||||
|
|
||||||
|
if (!options) options = {};
|
||||||
|
if (!options.headers) options.headers = {};
|
||||||
|
|
||||||
|
options = {
|
||||||
|
credentials: 'include',
|
||||||
|
...options
|
||||||
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
res = await fetch(`${config.apiUrl}${endpoint}`, options);
|
res = await fetch(`${config.apiUrl}${endpoint}`, options);
|
||||||
json = await res.json();
|
json = await res.json();
|
||||||
|
|
Loading…
Reference in a new issue