produzione 1 #9

Merged
JoeKung merged 135 commits from dev into main 2026-03-03 09:58:04 +01:00
3 changed files with 12 additions and 3 deletions
Showing only changes of commit 6952090865 - Show all commits

View File

@@ -47,8 +47,15 @@ export class QuoteEstimatorService {
formData.append('filament', this.mapMaterial(request.material)); formData.append('filament', this.mapMaterial(request.material));
formData.append('quality', this.mapQuality(request.quality)); 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`); 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 => { map(res => {
console.log('Response for', file.name, res); console.log('Response for', file.name, res);
return res; return res;

View File

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: true, production: true,
apiUrl: 'https://3d-fab.ch' apiUrl: 'https://3d-fab.ch',
basicAuth: ''
}; };

View File

@@ -1,4 +1,5 @@
export const environment = { export const environment = {
production: false, production: false,
apiUrl: 'http://localhost:8000' apiUrl: 'http://localhost:8000',
basicAuth: '' // Format: 'username:password'
}; };