mirror of
https://github.com/xtr-dev/rondevu-server.git
synced 2025-12-10 10:53:24 +00:00
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:
12
src/app.ts
12
src/app.ts
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user