#25 Update files base url
continuous-integration/drone/push Build is passing Details

This commit is contained in:
FyloZ 2022-02-27 21:01:07 -05:00
parent 6c8d35560e
commit cc24423389
Signed by: william
GPG Key ID: 835378AE9AF4AE97
3 changed files with 8 additions and 6 deletions

View File

@ -10,20 +10,20 @@ export function valueOr<T>(value: T, or: T): T {
const MEDIA_TYPE_PDF = 'application/pdf'
const MEDIA_TYPE_JPG = 'image/jpeg'
export function openPdf(url: string) {
openUrl(url, MEDIA_TYPE_PDF)
export function openPdf(uri: string) {
openFileUri(uri, MEDIA_TYPE_PDF)
}
export function openJpg(url: string) {
openUrl(url, MEDIA_TYPE_JPG)
export function openJpg(uri: string) {
openFileUri(uri, MEDIA_TYPE_JPG)
}
export function openTouchUpKit(touchUpKit: TouchUpKit) {
openRawUrl(`${environment.apiUrl}/touchupkit/pdf?project=${touchUpKit.project}`)
}
export function openUrl(url: string, mediaType: string) {
openRawUrl(`${url}&mediaType=${encodeURIComponent(mediaType)}`)
export function openFileUri(uri: string, mediaType: string) {
openRawUrl(`${environment.apiBaseUrl}${uri}&mediaType=${encodeURIComponent(mediaType)}`)
}
export function openRawUrl(url: string) {

View File

@ -1,4 +1,5 @@
export const environment = {
production: true,
apiBaseUrl: window.location.origin,
apiUrl: window.location.origin + '/api'
};

View File

@ -4,6 +4,7 @@
export const environment = {
production: false,
apiBaseUrl: 'http://localhost:9090',
apiUrl: 'http://localhost:9090/api'
};