PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

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