update pb collection and versioning setting is now in don in package.json

This commit is contained in:
2025-12-16 14:40:51 +00:00
parent 575c6e3311
commit ef613c238a
3 changed files with 28 additions and 2 deletions
+12
View File
@@ -17,6 +17,18 @@ const logLine = (path: string, line: string) => {
}
};
// Version endpoint sourced from package.json
app.get('/version', (c) => {
try {
const pkgRaw = fs.readFileSync('./package.json', 'utf-8');
const pkg = JSON.parse(pkgRaw);
return c.json({ version: pkg.version || '0.0.0' });
} catch (err) {
logLine('logs/error.log', `version endpoint error: ${(err as Error)?.message || String(err)}`);
return c.json({ version: '0.0.0' }, 200);
}
});
// Serve static files from the frontend directory
app.use('/*', serveStatic({ root: './frontend' }));