kizabgd123's picture
Upload pages/api/database/stats.js with huggingface_hub
31b1112 verified
raw
history blame contribute delete
453 Bytes
import { DatabaseManager } from '../../lib/database-manager';
export default function handler(req, res) {
if (req.method !== 'GET') {
return res.status(405).json({ error: 'Method not allowed' });
}
try {
const db = new DatabaseManager();
const stats = db.getStats();
res.status(200).json(stats);
} catch (error) {
console.error('Database error:', error);
res.status(500).json({ error: 'Failed to fetch stats' });
}
}