I’m outputting my Kirby content as a JSON API and using an Access-Control-Allow-Origin header to get the content from a different domain. The problem is that when I am trying to consume the API I get a 500 error when it sends the preflight OPTIONS request and this as the output:
{"status":"error","message":"Invalid route or request method"}
It seems that Kirby does not like the OPTIONS request but as I understand it, this is necessary for a CORS request. Any ideas on how to make this work?