/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

  1. <cfcomponent extends="taffy.core.api">
  2. <cfscript>
  3. this.name = hash(getCurrentTemplatePath());
  4. this.mappings["/resources"] = listDeleteAt(cgi.script_name, listLen(cgi.script_name, "/"), "/") & "/resources";
  5. variables.framework = {};
  6. variables.framework.debugKey = "debug";
  7. variables.framework.reloadKey = "reload";
  8. variables.framework.reloadPassword = "true";
  9. variables.framework.serializer = "taffy.core.nativeJsonSerializer";
  10. variables.framework.returnExceptionsAsJson = true;
  11. function onApplicationStart(){
  12. return super.onApplicationStart();
  13. }
  14. function onRequestStart(TARGETPATH){
  15. return super.onRequestStart(TARGETPATH);
  16. }
  17. // this function is called after the request has been parsed and all request details are known
  18. function onTaffyRequest(verb, cfc, requestArguments, mimeExt){
  19. // this would be a good place for you to check API key validity and other non-resource-specific validation
  20. return true;
  21. }
  22. </cfscript>
  23. </cfcomponent>