import { Hono } from 'hono';
import avRouter from "@/src/apis/admin-apis/apis/av-router"
import { ApiError } from "@/src/lib/api-error"
import v1Router from "@/src/v1-router"
import testController from "@/src/test-controller"
import { authenticateUser } from "@/src/middleware/auth.middleware"

const router = new Hono();

// Health check endpoints (no auth required)
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()
  });
});

// Apply authentication middleware to all subsequent routes
router.use('*', authenticateUser);

router.route('/v1', v1Router);
// router.route('/av', avRouter);
router.route('/test', testController);

const mainRouter = router;

export default mainRouter;
