tercul-frontend/server/routes/blog.ts
Damir Mukimov 4a23f496fa
Major frontend development updates
- Enhanced annotation system with improved inline editing
- Updated author components with new card and header designs
- Improved reading view with enhanced line numbering and controls
- Added new blog management features and tag management
- Updated UI components with improved accessibility and styling
- Enhanced search functionality with better filtering
- Added new dashboard features and activity feeds
- Improved translation selector and work comparison tools
- Updated GraphQL integration and API hooks
- Enhanced responsive design and mobile experience
2025-11-27 03:44:09 +01:00

25 lines
674 B
TypeScript

import { Router } from "express";
import type { Request } from "express";
import { graphqlClient } from "../lib/graphqlClient";
import { respondWithError } from "../lib/error";
import { BlogStatsDocument } from "@/shared/generated/graphql";
const router = Router();
// GET /api/blog/stats
interface GqlRequest extends Request {
gql?: typeof graphqlClient;
}
router.get("/stats", async (req: GqlRequest, res) => {
try {
const client = req.gql || graphqlClient;
const data = await client.request(BlogStatsDocument, {});
res.json(data.blog);
} catch (error) {
respondWithError(res, error, "Failed to fetch blog stats");
}
});
export default router;