const {httpStatus, httpStatusMessages} = require('../helpers/httpResponses')
function apiKeyValidation(req, res, next) {
    const apiKey = req.headers['x-api-key'];

    if (apiKey !== req.app.locals.apiKey) {
        return res.status(httpStatus.UNAUTHORIZED).json({message: 'Invalid API key'});
    }
    next();
}

module.exports = apiKeyValidation;