File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import './env.js' ; // Diese Zeile MUSS ganz oben stehen
21import path from 'path' ;
32
43import fs from 'fs' ;
Original file line number Diff line number Diff line change @@ -5,15 +5,26 @@ import { loadSecrets } from './utils/secretLoader.js';
55import { runPreflightChecks } from './utils/preflightChecks.js' ;
66
77const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) ) ;
8- dotenv . config ( { path : path . resolve ( __dirname , '../.env' ) } ) ;
98
10- // Load secrets from files (Docker Swarm / Kubernetes support)
9+ dotenv . config ( { path : path . resolve ( __dirname , '../.env' ) } ) ;
1110loadSecrets ( ) ;
1211
13- // Run pre-flight checks for essential environment variables
1412try {
1513 runPreflightChecks ( ) ;
1614} catch ( error ) {
17- process . exitCode = 1 ;
18- throw error ;
15+ console . error (
16+ 'PreflightChecks failed due to missing environment variables.' ,
17+ error
18+ ) ;
19+ // eslint-disable-next-line n/no-process-exit
20+ process . exit ( 1 ) ;
21+ }
22+
23+ console . log ( 'Starting server...' ) ;
24+ try {
25+ await import ( './SparkyFitnessServer.js' ) ;
26+ } catch ( error ) {
27+ console . error ( 'Failed to start the server module:' , error ) ;
28+ // eslint-disable-next-line n/no-process-exit
29+ process . exit ( 1 ) ;
1930}
Original file line number Diff line number Diff line change 1818 " coverage"
1919 ],
2020 "ext" : " js,ts,json" ,
21- "exec" : " tsx SparkyFitnessServer .ts"
21+ "exec" : " tsx index .ts"
2222}
You can’t perform that action at this time.
0 commit comments