const {createServer,startService}=require('./app/bridge.cjs'); const {main}=require('./app/application.cjs'); const {safeDiagnostic}=require('./shared/diagnostics.cjs'); const startupAt=performance.now(); if (require.main === module) main().then(app=>{ const stop=()=>app.stop().then(()=>process.exit(0),()=>process.exit(1)); process.once('SIGINT',stop);process.once('SIGTERM',stop); process.on('message',message=>{if(message==='order:shutdown')stop();}); console.info('启动耗时(ms):'+Math.round(performance.now()-startupAt)); }).catch(error => { console.error('启动失败:'+JSON.stringify(safeDiagnostic(error,{durationMs:performance.now()-startupAt}))); process.exitCode=1; }); module.exports = { createServer, startService, main };