mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
725 B
TypeScript
24 lines
725 B
TypeScript
const corsHeaders = {
|
|
'Access-Control-Allow-Origin': '*',
|
|
'Access-Control-Allow-Headers': 'authorization, x-client-info, apikey, content-type',
|
|
};
|
|
|
|
Deno.serve(async (req) => {
|
|
if (req.method === 'OPTIONS') {
|
|
return new Response(null, { headers: corsHeaders });
|
|
}
|
|
|
|
const apiKey = Deno.env.get('GOOGLE_MAPS_API_KEY');
|
|
if (!apiKey) {
|
|
return new Response(
|
|
JSON.stringify({ error: 'Google Maps API key not configured' }),
|
|
{ status: 500, headers: { ...corsHeaders, 'Content-Type': 'application/json' } }
|
|
);
|
|
}
|
|
|
|
return new Response(
|
|
JSON.stringify({ key: apiKey }),
|
|
{ headers: { ...corsHeaders, 'Content-Type': 'application/json', 'Cache-Control': 'private, max-age=3600' } }
|
|
);
|
|
});
|