Skip to content

Commit

Permalink
Relative / Absolute path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NadavTasher committed Feb 1, 2024
1 parent 0886ab5 commit 61a0188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion image/src/frontend/modules/api/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class API {
static async call(action, parameters = {}) {
// Execute request using fetch
const response = await fetch(`api/${action}`, {
const response = await fetch(`/api/${action}`, {
method: "POST",
body: JSON.stringify(parameters),
headers: {
Expand Down
4 changes: 2 additions & 2 deletions image/src/frontend/template/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Module {
// Create a script element
const element = document.createElement("script");
element.id = `script:${name}`;
element.src = `modules/${name}/module.js`;
element.src = `/modules/${name}/module.js`;

// Make sure script is not already loaded
if (document.getElementById(element.id)) {
Expand Down Expand Up @@ -50,7 +50,7 @@ class Module {
}

// Try fetching the HTML resource
const response = await fetch(`modules/${name}/module.html`);
const response = await fetch(`/modules/${name}/module.html`);
const resources = await response.text();

// Check if already exists
Expand Down

0 comments on commit 61a0188

Please sign in to comment.