tinylink/core/index.js
mahdahar 10f8dbbb83 refactor: consolidate core runtime and docs
Move middleware sources into core/, refresh config paths, and update design/user docs to reflect the raw payload pipeline.
2026-04-07 11:30:11 +07:00

23 lines
528 B
JavaScript

const logger = require('./logger');
const { start } = require('./app');
async function bootstrap() {
const { shutdown } = await start();
process.on('SIGINT', async () => {
logger.info('shutdown signal received');
await shutdown();
process.exit(0);
});
process.on('SIGTERM', async () => {
logger.info('terminate signal received');
await shutdown();
process.exit(0);
});
}
bootstrap().catch((err) => {
logger.fatal({ err: err.message }, 'failed to start middleware');
process.exit(1);
});