/examples/api/Application.cfc
http://github.com/atuttle/Taffy · ColdFusion CFScript · 30 lines · 21 code · 7 blank · 2 comment · 0 complexity · db1cfee718201d38f6cad07c070a7d42 MD5 · raw file
- <cfcomponent extends="taffy.core.api">
- <cfscript>
- this.name = hash(getCurrentTemplatePath());
- this.mappings["/resources"] = listDeleteAt(cgi.script_name, listLen(cgi.script_name, "/"), "/") & "/resources";
- variables.framework = {};
- variables.framework.debugKey = "debug";
- variables.framework.reloadKey = "reload";
- variables.framework.reloadPassword = "true";
- variables.framework.serializer = "taffy.core.nativeJsonSerializer";
- variables.framework.returnExceptionsAsJson = true;
- function onApplicationStart(){
- return super.onApplicationStart();
- }
- function onRequestStart(TARGETPATH){
- return super.onRequestStart(TARGETPATH);
- }
- // this function is called after the request has been parsed and all request details are known
- function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
- // this would be a good place for you to check API key validity and other non-resource-specific validation
- return true;
- }
- </cfscript>
- </cfcomponent>