33 lines
950 B
TypeScript
33 lines
950 B
TypeScript
/**
|
|
* Stock Bot Web API
|
|
* Entry point with WebSocket support
|
|
*/
|
|
|
|
import { getLogger } from '@stock-bot/logger';
|
|
import { initializeStockConfig } from '@stock-bot/stock-config';
|
|
|
|
// Initialize configuration with service-specific overrides
|
|
const config = initializeStockConfig('webApi');
|
|
|
|
// Override queue settings for web-api (no workers needed)
|
|
if (config.queue) {
|
|
config.queue.workers = 0;
|
|
config.queue.concurrency = 0;
|
|
config.queue.enableScheduledJobs = false;
|
|
}
|
|
|
|
// Log the full configuration
|
|
const logger = getLogger('web-api');
|
|
logger.info('Service configuration:', {
|
|
service: 'web-api',
|
|
port: config.service.port,
|
|
environment: config.environment,
|
|
});
|
|
|
|
// Import and start WebSocket-enabled server
|
|
import('./server-with-websocket').then(({ startServerWithWebSocket }) => {
|
|
startServerWithWebSocket().catch(error => {
|
|
logger.fatal('Failed to start web API service with WebSocket', { error });
|
|
process.exit(1);
|
|
});
|
|
});
|