feat(web) back-end routing
All checks were successful
Build, Test and Deploy / test-backend (push) Successful in 15s
Build, Test and Deploy / build-and-push (push) Successful in 26s
Build, Test and Deploy / deploy (push) Successful in 5s

This commit is contained in:
2026-01-31 17:41:47 +01:00
parent 179ba2b85c
commit 85d7315e30
6 changed files with 28 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ services:
image: ${REGISTRY_URL}/${REPO_OWNER}/print-calculator-frontend:${TAG} image: ${REGISTRY_URL}/${REPO_OWNER}/print-calculator-frontend:${TAG}
container_name: print-calculator-frontend-${ENV} container_name: print-calculator-frontend-${ENV}
ports: ports:
- "${FRONTEND_PORT}:80" - "${FRONTEND_PORT}:8008"
depends_on: depends_on:
- backend - backend
restart: unless-stopped restart: unless-stopped

View File

@@ -39,6 +39,19 @@
}, },
"configurations": { "configurations": {
"production": { "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": [ "budgets": [
{ {
"type": "initial", "type": "initial",
@@ -50,8 +63,7 @@
"maximumWarning": "4kB", "maximumWarning": "4kB",
"maximumError": "8kB" "maximumError": "8kB"
} }
], ]
"outputHashing": "all"
}, },
"development": { "development": {
"optimization": false, "optimization": false,
@@ -59,6 +71,7 @@
"sourceMap": true "sourceMap": true
} }
}, },
"defaultConfiguration": "production" "defaultConfiguration": "production"
}, },
"serve": { "serve": {

View File

@@ -20,6 +20,8 @@ interface QuoteResponse {
}; };
} }
import { environment } from '../../environments/environment';
@Component({ @Component({
selector: 'app-calculator', selector: 'app-calculator',
standalone: true, standalone: true,
@@ -61,7 +63,7 @@ export class CalculatorComponent {
this.error = ''; this.error = '';
this.results = null; this.results = null;
this.http.post<QuoteResponse>('http://localhost:8000/calculate/stl', formData) this.http.post<QuoteResponse>(`${environment.apiUrl}/calculate/stl`, formData)
.subscribe({ .subscribe({
next: res => { next: res => {
this.results = res; this.results = res;

View File

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

View File

@@ -0,0 +1,4 @@
export const environment = {
production: false,
apiUrl: 'http://localhost:8000'
};

View File

@@ -2,6 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Frontend</title> <title>Frontend</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">