Created
April 5, 2016 16:24
-
-
Save shaik2many/95225d11c8508637ae3fad9e8936614a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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