export default { async fetch(request) { const url = new URL(request.url); if (url.pathname !== '/hello') return new Response('Not found', {status:404}); if (request.method !== 'GET') return new Response('Method not allowed', {status:405}); const name = (url.searchParams.get('name') ?? '').trim(); return Response.json({message:`Hello, ${name || 'friend'}!`}); } };