34 lines
878 B
TypeScript
Executable file
34 lines
878 B
TypeScript
Executable file
import { Hono } from 'hono'
|
|
import { authenticateUser } from '@/src/middleware/auth.middleware'
|
|
import v1Router from '@/src/v1-router'
|
|
|
|
// Note: This router is kept for compatibility during migration
|
|
// Most routes have been moved to tRPC
|
|
const router = new Hono()
|
|
|
|
// Health check endpoints (no auth required)
|
|
// Note: These are also defined in index.ts, keeping for compatibility
|
|
router.get('/health', (c) => {
|
|
return c.json({
|
|
status: 'OK',
|
|
timestamp: new Date().toISOString(),
|
|
uptime: process.uptime(),
|
|
message: 'Hello world'
|
|
})
|
|
})
|
|
|
|
router.get('/seed', (c) => {
|
|
return c.json({
|
|
status: 'OK',
|
|
timestamp: new Date().toISOString(),
|
|
uptime: process.uptime()
|
|
})
|
|
})
|
|
|
|
// Mount v1 routes (REST API)
|
|
router.route('/v1', v1Router)
|
|
|
|
// Apply authentication middleware to all subsequent routes
|
|
router.use('*', authenticateUser)
|
|
|
|
export default router
|