diff --git a/src/client/vite.config.ts b/src/client/vite.config.ts index a0a80e7..3345a24 100644 --- a/src/client/vite.config.ts +++ b/src/client/vite.config.ts @@ -10,7 +10,7 @@ export default defineConfig({ }, clearScreen: false, server: { - host: '0.0.0.0', + // host: '0.0.0.0', proxy: { '/socket.io': { target: 'ws://localhost:12345', diff --git a/src/server/router/telemetry.ts b/src/server/router/telemetry.ts index 7b026ca..aabfe9b 100644 --- a/src/server/router/telemetry.ts +++ b/src/server/router/telemetry.ts @@ -73,18 +73,21 @@ telemetryRouter.get( query('name').optional().isString(), query('url').optional().isURL(), query('title').optional().isString(), - query('start').optional().isNumeric() + query('start').optional().isNumeric(), + query('fullNum').optional().isBoolean() ), async (req, res) => { const title = req.query.title || 'visitor'; const start = req.query.start ? Number(req.query.start) : 0; + const fullNum = req.query.fullNum === 'true'; recordTelemetryEvent(req); const num = await sumTelemetryEvent(req); + const count = num + start; const svg = makeBadge({ label: String(title), - message: numify(num + start), + message: fullNum ? String(count) : numify(count), color: 'green', });