the-tip-top-backend/index.js
wkadmin 77f9a0aecc
All checks were successful
the-tip-top-backend/pipeline/head This commit looks good
Actualiser index.js
2025-10-21 17:48:35 +00:00

25 lines
608 B
JavaScript

import express from 'express';
import client from 'prom-client';
const app = express();
const PORT = process.env.PORT || 4000;
// Crée un registre de métriques Prometheus
const register = new client.Registry();
client.collectDefaultMetrics({ register });
// Route API
app.get('/', (req, res) => {
res.send('The Tip Top Backend is running 🚀');
});
// Route /metrics pour Prometheus
app.get('/metrics', async (req, res) => {
res.set('Content-Type', register.contentType);
res.end(await register.metrics());
});
app.listen(PORT, () => {
console.log(`✅ Backend running on port ${PORT}`);
});