first commit

This commit is contained in:
2026-04-11 14:08:27 +07:00
parent e86e5d2c46
commit 6b7655aa16
389 changed files with 5387 additions and 60861 deletions

17
middleware/apiKey.js Normal file
View File

@@ -0,0 +1,17 @@
/**
* API Key middleware
* Validates the api_key query parameter against process.env.API_KEY
* Spec: GET /api/verify-degree/{id}?api_key={API_KEY}
*/
function validateApiKey(req, res, next) {
const apiKey = req.query.api_key;
if (!apiKey || apiKey !== process.env.API_KEY) {
return res.status(401).json({ error: 'Unauthorized - Invalid API key' });
}
next();
}
module.exports = { validateApiKey };