i resolveed the cors issue now its block,
here is the code of function:
// This Appwrite function will be executed every time your function is triggered
export default async ({ req, res, log, error }) => {
// Handle preflight (OPTIONS) requests for CORS
if (req.method === 'OPTIONS') {
return res.send('', 204, {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Appwrite-Key'
});
}
return res.json({
motto: "HELLO CORS!"
}, 200, {
"Access-Control-Allow-Origin": "*",
});
};