dev #3
@@ -23,7 +23,7 @@ services:
|
||||
image: ${REGISTRY_URL}/${REPO_OWNER}/print-calculator-frontend:${TAG}
|
||||
container_name: print-calculator-frontend-${ENV}
|
||||
ports:
|
||||
- "${FRONTEND_PORT}:80"
|
||||
- "${FRONTEND_PORT}:8008"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -39,6 +39,19 @@
|
||||
},
|
||||
"configurations": {
|
||||
"production": {
|
||||
"fileReplacements": [
|
||||
{
|
||||
"replace": "src/environments/environment.ts",
|
||||
"with": "src/environments/environment.prod.ts"
|
||||
}
|
||||
],
|
||||
"optimization": true,
|
||||
"outputHashing": "all",
|
||||
"sourceMap": false,
|
||||
"namedChunks": false,
|
||||
"aot": true,
|
||||
"extractLicenses": true,
|
||||
|
||||
"budgets": [
|
||||
{
|
||||
"type": "initial",
|
||||
@@ -50,8 +63,7 @@
|
||||
"maximumWarning": "4kB",
|
||||
"maximumError": "8kB"
|
||||
}
|
||||
],
|
||||
"outputHashing": "all"
|
||||
]
|
||||
},
|
||||
"development": {
|
||||
"optimization": false,
|
||||
@@ -59,6 +71,7 @@
|
||||
"sourceMap": true
|
||||
}
|
||||
},
|
||||
|
||||
"defaultConfiguration": "production"
|
||||
},
|
||||
"serve": {
|
||||
|
||||
@@ -20,6 +20,8 @@ interface QuoteResponse {
|
||||
};
|
||||
}
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
@Component({
|
||||
selector: 'app-calculator',
|
||||
standalone: true,
|
||||
@@ -61,7 +63,7 @@ export class CalculatorComponent {
|
||||
this.error = '';
|
||||
this.results = null;
|
||||
|
||||
this.http.post<QuoteResponse>('http://localhost:8000/calculate/stl', formData)
|
||||
this.http.post<QuoteResponse>(`${environment.apiUrl}/calculate/stl`, formData)
|
||||
.subscribe({
|
||||
next: res => {
|
||||
this.results = res;
|
||||
|
||||
4
frontend/src/environments/environment.prod.ts
Normal file
4
frontend/src/environments/environment.prod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://3d-fab.ch/api'
|
||||
};
|
||||
4
frontend/src/environments/environment.ts
Normal file
4
frontend/src/environments/environment.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:8000'
|
||||
};
|
||||
@@ -2,6 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Frontend</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
Reference in New Issue
Block a user