takeSnap
Suvodip 2025-03-11 18:02:28 +05:30
parent 8e0cce2465
commit 6d380c6cbb
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,8 @@ const takeSnap = async (req, res) => {
// Set CORS headers // Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*'); // Allow all origins res.setHeader('Access-Control-Allow-Origin', '*'); // Allow all origins
res.setHeader('Access-Control-Allow-Methods', 'POST, OPTIONS'); // Allow POST and OPTIONS methods
res.setHeader('Access-Control-Allow-Headers', 'Content-Type'); // Allow Content-Type header
// Handle preflight request (OPTIONS) // Handle preflight request (OPTIONS)
if (req.method === 'OPTIONS') { if (req.method === 'OPTIONS') {