Spaces:
Running
Running
github-actions[bot]
Sync from GitHub Viciy2023/Qwen2API-A@ae093476e9bc5b0a599620b5925df3a20057038e
f120063 | const express = require('express') | |
| const router = express.Router() | |
| const config = require('../config/index.js') | |
| const { validateApiKey } = require('../middlewares/authorization') | |
| router.post('/verify', (req, res) => { | |
| const apiKey = req.body.apiKey | |
| const { isValid, isAdmin } = validateApiKey(apiKey) | |
| if (!isValid) { | |
| return res.status(401).json({ | |
| status: 401, | |
| message: 'Unauthorized' | |
| }) | |
| } | |
| res.status(200).json({ | |
| status: 200, | |
| message: 'success', | |
| isAdmin: isAdmin | |
| }) | |
| }) | |
| module.exports = router | |