Reputation: 21
I am new to Taffy API framework. Trying to run the examples with Lucee but I get this error
invalid component definition, can't find component [resources.throwsException]
But it works all fine with ColdFusion.
May I miss something that it's very obvious. Or some mappings are required in Lucee but not in ColdFusion.
Thanks.
Below are the screen caps for additional details.
The webroot is folder name is play_taffy, under webroot, it is taffy with the lib and examples folder.
Upvotes: 2
Views: 606
Reputation: 11120
There are a lot of things going on here, so let me unpack them one by one. Taffy is very powerful and has a lot of functionality. It is worth the time. The examples on the other had also try to cover a lot of stuff. They kind of use a non standard approach to the directory structure.
Short answer
Based on your error message, one of two thing are happening, either ./Taffy/examples/api_LogToEmail/resources/savesLog.cfc
does not exist or it has a path mapping in <cfcomponent extends="taffy.core.resource" taffy_uri="/foo">
that is not resolving.
Long answer
I see that you are using Ortus CommandBox. (Shameless plug follows). I have written code and have code on how to do this. If you go to https://github.com/jmohler1970/Taffy_video , You can find the first video.
If you go to https://coldfusion.adobe.com/profile/jamesmohler and click on blog, you will find eight videos on this very topic.
Some code
Over on, https://github.com/jmohler1970/Taffy_video Taffy,
Consider the following directory structure:
box.json has
{
"dependencies":{
"taffy":"git://github.com/atuttle/Taffy.git",
"formutils":"git://github.com/jmohler1970/FormUtils.git",
"northamerica":"git://github.com/jmohler1970/NorthAmerica.git"
},
"installPaths":{
"taffy":"taffy",
"formutils":"formutils",
"northamerica":"db_setup"
}
}
Note in the code that Taffy is no where to be seen. We have a very clean structure. Taffy has not been applied to it yet. This is a good thing. Because I know where Taffy in a more normal way. I don't have to wonder why the examples are the way the are. I can just worry about my own code.
application.cfc
component extends="taffy.core.api" {
...
this.mappings['/resources'] = expandPath('./resources');
this.mappings['/taffy'] = expandPath('./taffy');
This is where I get the mappings to work. This is likely different from the Taffy examples, but is much closer to what you might use in a production environment
Upvotes: 1