This commit is contained in:
paoloar77
2025-02-19 09:26:13 +01:00
parent f39818f6a7
commit 3d8047b019

View File

@@ -23,8 +23,10 @@ const config = {
// Middleware per verificare l'API Key
app.use((req, res, next) => {
console.log('Middleware per verificare l\'API Key...')
const apiKey = req.headers['x-api-key'];
if (apiKey !== API_KEY) {
console.error('APIKEY NON CORRETTA !')
return res.status(403).json({ error: 'Accesso negato' });
}
next();