feat: versionamento visível (rodapé + /api/version + carimbo no build)
- backend: endpoint GET /api/version + linha [VERSION] no boot (le APP_VERSION/GIT_COMMIT/BUILD_TIME/APP_ENV) - frontend: buildInfo.ts le import.meta.env.VITE_* ; versão no rodapé do Sidebar - Dockerfiles (front+back): ARG/ENV do carimbo de versão - docker-compose.yml: build args (APP_VERSION/GIT_COMMIT/BUILD_TIME/APP_ENV) com defaults - bump V1.0.12 -> V1.0.13 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -171,6 +171,16 @@ app.use(cors({
|
||||
// --- HEALTH CHECK ---
|
||||
app.get('/api/ping', (req, res) => res.json({ status: 'ok', ts: new Date().toISOString() }));
|
||||
|
||||
// --- VERSION / BUILD INFO (carimbado no build via ARGs do Dockerfile) ---
|
||||
const BUILD_INFO = {
|
||||
name: 'ScoreOdonto API',
|
||||
version: process.env.APP_VERSION || 'dev',
|
||||
commit: process.env.GIT_COMMIT || 'dev',
|
||||
build: process.env.BUILD_TIME || '',
|
||||
environment: (process.env.APP_ENV || 'DEV').toUpperCase(),
|
||||
};
|
||||
app.get('/api/version', (req, res) => res.json(BUILD_INFO));
|
||||
|
||||
// =============================================================================
|
||||
// SECURITY MIDDLEWARE: Tenant Guard
|
||||
// =============================================================================
|
||||
@@ -7985,6 +7995,7 @@ app.post('/api/admin/repasses/:id/confirmar', adminGuard, async (req, res) => {
|
||||
|
||||
const httpServer = app.listen(PORT, '0.0.0.0', async () => {
|
||||
console.log(`[SERVER] Running on http://0.0.0.0:${PORT}`);
|
||||
console.log(`[VERSION] ${BUILD_INFO.name} ${BUILD_INFO.version} · commit ${BUILD_INFO.commit} · build ${BUILD_INFO.build || 'n/a'} · ${BUILD_INFO.environment}`);
|
||||
await loadGoogleCredsFromDb();
|
||||
await runMigrations();
|
||||
await seedContratoModelos();
|
||||
|
||||
Reference in New Issue
Block a user