Inspired on https://github.com/fruitcake/laravel-cors and https://github.com/asm89/stack-cors
The CodeIgniterCORS
library allows you to send CORS [Cross-Origin Resource Sharing] headers with CodeIgniter 4 (https://github.com/codeigniter4/CodeIgniter4).
More info about Cross-Origin Resource Sharing:
http://enable-cors.org
https://developer.mozilla.org/en/docs/Web/HTTP/CORS
I only tested this in a simple case.
Let me know if you notice any issue.