Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Created April 5, 2016 16:24
Show Gist options
  • Save shaik2many/95225d11c8508637ae3fad9e8936614a to your computer and use it in GitHub Desktop.
Save shaik2many/95225d11c8508637ae3fad9e8936614a to your computer and use it in GitHub Desktop.
component extends="taffy.core.api" {
this.name = hash(getCurrentTemplatePath());
this.SessionManagement = true;
this.datasource = "abc";
variables.framework = {};
function onApplicationStart(){
return super.onApplicationStart();
}
/**
* This method acts like a Request interceptor
* Security or Connection Key can be verified here
*/
function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
/*if(not structKeyExists(arguments.requestArguments, "connection_key")){
//unauthorized because they haven't included their API key
return noData().withStatus(401);
}*/
var response = getPageContext().getResponse();
response.setHeader("Access-Control-Allow-Origin","*");
//api key found
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment