Move / endpoint to /topics and add version endpoint

- Move GET / to GET /topics for listing topics
- Add new GET / endpoint that returns server version (git commit hash)
- Update build.js to inject git commit hash as RONDEVU_VERSION
- Update API documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-08 11:34:54 +01:00
parent b89d281548
commit d4aefb93b0
3 changed files with 62 additions and 10 deletions

View File

@@ -50,10 +50,20 @@ export function createApp(storage: Storage, config: AppConfig) {
/**
* GET /
* Returns server version information
*/
app.get('/', (c) => {
return c.json({
version: process.env.RONDEVU_VERSION || 'unknown'
});
});
/**
* GET /topics
* Lists all topics with their unanswered session counts (paginated)
* Query params: page (default: 1), limit (default: 100, max: 1000)
*/
app.get('/', async (c) => {
app.get('/topics', async (c) => {
try {
const origin = getOrigin(c);
const page = parseInt(c.req.query('page') || '1', 10);