// module.exports = (req, res, next) => {
//     res.setHeader('Access-Control-Allow-Origin', 'http://localhost');
//     res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE');
//     res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization', 'Cache-Control');
//     res.setHeader('Access-Control-Allow-Credentials', 'true');

//     if (req.method === 'OPTIONS') {
//         return res.sendStatus(204);
//     }

//     next();
// };

module.exports = (req, res, next) => {
	// res.setHeader("Access-Control-Allow-Origin", "*");
	res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH, DELETE');
	res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization');
	next();
};
