markusahlstrand/cloudworker-router

Cors

Closed this issue · 1 comments

How to pass allow request from origin?

Sorry for the really late reply. It's a standard Response request so just add the CORS headers:

 return new Response(
      'Hello',
      {
        status: 200,
        headers: {
          'access-control-allow-origin': '*',
          'content-type': 'text/html',
        },
      },
    );