Create toggles.ts

This commit is contained in:
2024-08-13 20:16:54 +05:00
committed by GitHub
parent 4f467ab5f3
commit a400a72db0

View File

@@ -0,0 +1,11 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import toggles from './src/pages/api/extension/config/toggles.json'; // Путь к твоему JSON-файлу
export default function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method === 'GET') {
res.status(200).json(toggles);
} else {
res.setHeader('Allow', ['GET']);
res.status(405).end(`Method ${req.method} Not Allowed`);
}
}