-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
44 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import axios from "axios"; | ||
|
||
import axios from 'axios' | ||
|
||
export async function getEndpoints(): Promise<Array<string>> { | ||
const origin = window.location.origin | ||
const backendUrl = `${origin}/api/v1` | ||
const endpointUrl = `${backendUrl}/endpoints` | ||
const response = await axios.get<Array<string>>(endpointUrl) | ||
|
||
const origin = window.location.origin; | ||
const backendUrl = `${origin}/api/v1` | ||
const endpointUrl = `${backendUrl}/endpoints`; | ||
const response = await axios.get<Array<string>>(endpointUrl) | ||
|
||
if (response.status !== 200) { | ||
throw new Error("Could not fetch endpoints") | ||
} | ||
if (response.status !== 200) { | ||
throw new Error('Could not fetch endpoints') | ||
} | ||
|
||
const endpoints = response.data; | ||
endpoints.push(backendUrl) | ||
const endpoints = response.data | ||
endpoints.push(backendUrl) | ||
|
||
return endpoints | ||
return endpoints | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters