Skip to content

Commit

Permalink
Correct API paths
Browse files Browse the repository at this point in the history
  • Loading branch information
campb303 committed Mar 14, 2021
1 parent 17a2847 commit dfbc048
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webqueue2",
"homepage": "/webqueue/q2",
"homepage": "",
"proxy": "http://localhost:5000/",
"version": "0.1.0",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppView/AppView.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function AppView({ setDarkMode }){
myHeaders.append("Authorization", `Bearer ${access_token}`);
let requestOptions = { headers: myHeaders };

const apiResponse = await fetch(`/api/${queuesToLoad}`, requestOptions);
const apiResponse = await fetch(`${process.env.PUBLIC_URL}/api/data/${queuesToLoad}`, requestOptions);
const queueJson = await apiResponse.json();

setQueues(queueJson);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItemView/ItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ItemView({ queue, number }) {
myHeaders.append("Authorization", `Bearer ${access_token}`);
let requestOptions = { headers: myHeaders };

const apiResponse = await fetch(`/api/${queue}/${number}`, requestOptions);
const apiResponse = await fetch(`${process.env.PUBLIC_URL}/api/data/${queue}/${number}`, requestOptions);

if (!apiResponse.ok) {
console.error(`Fetching item ${queue}${number}. Got code ${apiResponse.status} (${apiResponse.statusText})`);
Expand Down

0 comments on commit dfbc048

Please sign in to comment.