initialize project structure with core modules and configuration

This commit is contained in:
ImBenji
2026-04-16 22:47:34 +01:00
parent 82d856a21d
commit 7724fafbdc
20 changed files with 3644 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
const Fastify = require('fastify');
const articleRoutes = require('./src/routes/articles');
const statusRoutes = require('./src/routes/status');
const config = require('./src/config');
const { startScheduler, runAllIngestions } = require('./src/scheduler');
const app = Fastify({ logger: true });
app.register(articleRoutes);
app.register(statusRoutes);
app.get('/', async () => ({ ok: true }));
async function start() {
await app.listen({ port: config.server.port, host: config.server.host });
runAllIngestions().catch((error) => {
app.log.error(error);
});
startScheduler();
}
start().catch((error) => {
app.log.error(error);
process.exit(1);
});