Implementierung von Lebenszyklusprotokollierung und Serverstartstatistiken
All checks were successful
Deploy SingleChat / deploy (push) Successful in 48s
All checks were successful
Deploy SingleChat / deploy (push) Successful in 48s
This commit is contained in:
@@ -9,12 +9,14 @@ import { dirname, join } from 'path';
|
||||
import { setupBroadcast } from './broadcast.js';
|
||||
import { setupRoutes } from './routes.js';
|
||||
import { setupSEORoutes } from './routes-seo.js';
|
||||
import { installLifecycleHandlers, logServerStart } from './server-lifecycle.js';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const app = express();
|
||||
const server = createServer(app);
|
||||
installLifecycleHandlers(__dirname, server);
|
||||
|
||||
// Umgebungsvariablen
|
||||
const NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
@@ -233,6 +235,7 @@ if (IS_PRODUCTION) {
|
||||
const HOST = process.env.HOST || '127.0.0.1';
|
||||
|
||||
server.listen(PORT, HOST, () => {
|
||||
logServerStart(__dirname);
|
||||
console.log(`Server läuft auf http://${HOST}:${PORT}`);
|
||||
console.log(`Umgebung: ${NODE_ENV}`);
|
||||
console.log(`CORS erlaubt für: ${allowedOrigins.join(', ')}`);
|
||||
|
||||
Reference in New Issue
Block a user