-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: reconcile src/ui/services and VITE_API_URI env loading
- Loading branch information
1 parent
25dbeb7
commit 832274d
Showing
6 changed files
with
189 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_URI=http://localhost:8080 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_API_URI= |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import axios from 'axios'; | ||
|
||
const baseUrl = import.meta.env.VITE_API_URI | ||
? `${import.meta.env.VITE_API_URI}/api/v1` | ||
: `${location.origin}/api/v1`; | ||
|
||
const getAttestationConfig = async (setData) => { | ||
const url = new URL(`${baseUrl}/config/attestation`); | ||
await axios(url.toString()).then((response) => { | ||
setData(response.data.questions); | ||
}); | ||
}; | ||
|
||
const getURLShortener = async (setData) => { | ||
const url = new URL(`${baseUrl}/config/urlShortener`); | ||
await axios(url.toString()).then((response) => { | ||
setData(response.data); | ||
}); | ||
}; | ||
|
||
const getEmailContact = async (setData) => { | ||
const url = new URL(`${baseUrl}/config/contactEmail`); | ||
await axios(url.toString()).then((response) => { | ||
setData(response.data); | ||
}); | ||
}; | ||
|
||
export { getAttestationConfig, getURLShortener, getEmailContact }; |
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