Modernization Project Complete. Updated to latest versions of frameworks.

This commit is contained in:
Eric Gullickson
2025-08-24 09:49:21 -05:00
parent 673fe7ce91
commit b534e92636
46 changed files with 2341 additions and 5267 deletions

View File

@@ -1,36 +1,45 @@
/**
* @ai-summary Application entry point
* @ai-context Starts the Express server with all feature capsules
* @ai-context Starts the Fastify server with all feature capsules
*/
import { app } from './app';
import { buildApp } from './app';
import { env } from './core/config/environment';
import { logger } from './core/logging/logger';
const PORT = env.PORT || 3001;
const server = app.listen(PORT, () => {
logger.info(`MotoVaultPro backend running`, {
port: PORT,
environment: env.NODE_ENV,
nodeVersion: process.version,
});
});
async function start() {
try {
const app = await buildApp();
await app.listen({
port: PORT,
host: '0.0.0.0'
});
logger.info(`MotoVaultPro backend running`, {
port: PORT,
environment: env.NODE_ENV,
nodeVersion: process.version,
framework: 'Fastify'
});
} catch (error) {
logger.error('Failed to start server', { error });
process.exit(1);
}
}
start();
// Graceful shutdown
process.on('SIGTERM', () => {
logger.info('SIGTERM received, shutting down gracefully');
server.close(() => {
logger.info('Server closed');
process.exit(0);
});
process.exit(0);
});
process.on('SIGINT', () => {
logger.info('SIGINT received, shutting down gracefully');
server.close(() => {
logger.info('Server closed');
process.exit(0);
});
process.exit(0);
});
// Handle uncaught exceptions