Compare commits
2 Commits
10e1fb49f4
...
a5ff515fd7
| Author | SHA1 | Date | |
|---|---|---|---|
| a5ff515fd7 | |||
| 6952090865 |
@@ -47,8 +47,15 @@ export class QuoteEstimatorService {
|
||||
formData.append('filament', this.mapMaterial(request.material));
|
||||
formData.append('quality', this.mapQuality(request.quality));
|
||||
|
||||
const headers: any = {};
|
||||
// @ts-ignore
|
||||
if (environment.basicAuth) {
|
||||
// @ts-ignore
|
||||
headers['Authorization'] = 'Basic ' + btoa(environment.basicAuth);
|
||||
}
|
||||
|
||||
console.log(`Sending file: ${file.name} to ${environment.apiUrl}/api/quote`);
|
||||
return this.http.post<BackendResponse>(`${environment.apiUrl}/api/quote`, formData).pipe(
|
||||
return this.http.post<BackendResponse>(`${environment.apiUrl}/api/quote`, formData, { headers }).pipe(
|
||||
map(res => {
|
||||
console.log('Response for', file.name, res);
|
||||
return res;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://3d-fab.ch'
|
||||
apiUrl: 'https://3d-fab.ch',
|
||||
basicAuth: ''
|
||||
};
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:8000'
|
||||
apiUrl: 'https://dev.3d-fab.ch',
|
||||
basicAuth: 'fab:0presura' // Format: 'username:password'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user