This adds defaults for CORS support into the JSON server paradigm. Different handling can be accomplished by using the Validation step to adjust headers in the response. Additionally, if you don't want to use any defaults at all and just want to tweak your response completely, then you can signal an immediate response from the Validation frunction by return a -1 instead of a 0. Otherwise, you can set only the headers you want, and then use the defaults by returning 0 and letting the request fall through.
This adds defaults for CORS support into the JSON server paradigm. Different handling can be accomplished by using the Validation step to adjust headers in the response. Additionally, if you don't want to use any defaults at all and just want to tweak your response completely, then you can signal an immediate response from the Validation frunction by return a -1 instead of a 0. Otherwise, you can set only the headers you want, and then use the defaults by returning 0 and letting the request fall through.