feat: Add Pino structured logging, release-please CI/CD and Docker pipeline

Replace all console.log/error with Pino logger (info/warn/error/debug/fatal)
for structured JSON logging in production and pretty-print in development.
Remove redundant header dumps and consolidate rate-limit logging.

Add GitHub Actions workflow with release-please for automated semver releases
and Docker build/push to GHCR on new releases.
This commit is contained in:
Samuel Enocsson
2026-02-21 15:56:57 +01:00
parent 371a398446
commit 6ac32457a9
14 changed files with 498 additions and 189 deletions
+3 -2
View File
@@ -5,6 +5,7 @@ const { initializeDatabase, checkAndPopulateDatabase } = require('./src/db');
const playerRoutes = require('./src/routes/players');
const courseRoutes = require('./src/routes/courses');
const pageRoutes = require('./src/routes/pages');
const logger = require('./src/logger');
const app = express();
const PORT = 3000;
@@ -22,9 +23,9 @@ initializeDatabase().then(async () => {
await checkAndPopulateDatabase();
app.listen(PORT, () => {
console.log(`PDGA Ratings app running on http://localhost:${PORT}`);
logger.info(`PDGA Ratings app running on http://localhost:${PORT}`);
});
}).catch(err => {
console.error('Failed to initialize database:', err);
logger.fatal('Failed to initialize database:', err);
process.exit(1);
});