Skip to content

Commit

Permalink
Fix hard coded url and port inside JS
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudDauce committed May 31, 2023
1 parent fe856fb commit 31c6842
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2>Index list</h2>
let indexes = [];

const fetchIndexes = async () => {
const response = await fetch("http://0.0.0.0:8080/indexes", {
const response = await fetch("/indexes", {
method: 'GET',
headers: {
'Content-Type': 'application/json'
Expand Down Expand Up @@ -111,7 +111,7 @@ <h2>Index list</h2>
document.getElementById('new_index').addEventListener('submit', async (e) => {
e.preventDefault();

let response = await fetch("http://0.0.0.0:8080/indexes", {
let response = await fetch("/indexes", {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down Expand Up @@ -145,7 +145,7 @@ <h2>Index list</h2>
})

document.getElementById('delete').addEventListener('click', async () => {
const response = await fetch(`http://0.0.0.0:8080/indexes/${indexId}`, {
const response = await fetch(`/indexes/${indexId}`, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit 31c6842

Please sign in to comment.