feat: add database indexes, implement CORS configuration, and lazy-load frontend routes
Build and Push Multi-Platform Images / build-and-push (push) Successful in 35s

This commit is contained in:
2026-05-10 22:21:01 +02:00
parent aa4c181b0c
commit 1ed3afd2e2
6 changed files with 52 additions and 35 deletions
@@ -1,4 +1,4 @@
import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
import { Entity, PrimaryGeneratedColumn, Column, Index, OneToMany } from 'typeorm';
import { Attachment } from './attachment.entity';
@Entity('Emails')
@@ -18,12 +18,14 @@ export class Email {
@Column({ type: 'varchar', length: 500 })
Subject!: string;
@Index()
@Column({ type: 'datetime' })
Date!: Date;
@Column({ type: 'longtext' })
Body!: string;
@Index()
@Column({ type: 'int', default: 0 })
Status!: number;
@@ -2,6 +2,7 @@ import {
Entity,
PrimaryGeneratedColumn,
Column,
Index,
CreateDateColumn,
} from 'typeorm';
@@ -10,6 +11,7 @@ export class LabelPrintJob {
@PrimaryGeneratedColumn()
Id!: number;
@Index()
@Column({ type: 'varchar', length: 20, default: 'pending' })
Status!: 'pending' | 'printed' | 'error';
@@ -28,6 +30,7 @@ export class LabelPrintJob {
@Column({ type: 'simple-json', nullable: true })
LabelVariables!: Record<string, string> | null;
@Index()
@Column({ type: 'datetime', nullable: true })
LockedAt!: Date | null;
@@ -1,10 +1,11 @@
import { Entity, PrimaryColumn, Column } from 'typeorm';
import { Entity, PrimaryColumn, Column, Index } from 'typeorm';
@Entity('tasks')
export class Task {
@PrimaryColumn({ type: 'varchar', length: 36 })
TaskId!: string;
@Index()
@Column({ type: 'varchar', length: 50 })
InterneBelegnummer!: string;
@@ -14,6 +15,7 @@ export class Task {
@Column({ type: 'datetime', nullable: true })
Eingangsdatum!: Date | null;
@Index()
@Column({ type: 'tinyint', nullable: true })
Fertig!: number | null;
+1 -1
View File
@@ -7,7 +7,7 @@ async function bootstrap(): Promise<void> {
const port = process.env.PORT ?? 3100;
app.enableCors({
origin: '*', // Für lokale Entwicklung zulassen, oder spezifisch: 'http://localhost:8080'
origin: process.env.CORS_ORIGIN ?? (process.env.NODE_ENV === 'production' ? false : '*'),
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
credentials: true,
});