I guess I’m hoping for better/easier access to request/response objects
I dont want to call it ‘page request’ as api reponse isn’t a page, and as we serve more and more api requests alongside html requests, a more generic approach needs to be looked at.
It would be great to be able to more easily set values for headers, status, content body etc without having to wire this into a framework (the less overhead the better), even if these are simply helper functions it makes sense as we have handles on cookies and other things, to have a service/factory/something to manage request and response object.
Would also be great to have a “beforeResponseReturn” and “beforeRequestStart” event triggers also so that data protection and data security layers could be run ( potentially server wide from server.cfc ) giving lucee an extra cool set of security events that utilities like fuseguard and other inhouse opsec systems could hook into.
Basically looking for more page lifecycle handles CFML style easy abstractions.
header.setAccessControl("Allow-Origin","GET, POST, PUT, DELETE, OPTIONS')
header.setAllowMethods('GET, POST, PUT, DELETE, OPTIONS')
content.setBody('<html></html>');
content.setType('application/json');
header.setAuthorization('Bearer #token#');
header.setStatus(200) or context.set(200,"OK Bro")
header.exposeHeaders('Content-Type, Authorization')