I’m creating a simple shipping cart module where I would like the module to be the defaultEvent within an application. What I did in the ColdBox.cfc for defaultEvent is to set “[module entry point]:event:action”.
However, I’ve been reading about routing in ColdBox and would like some recommendation on how to utilize route to make the module the default event:action within an application.
For example, how would I force ColdBox the following URL to default to a Module event:action - http://somedomain.com/
Also, how would I write the routing for the following example? http://somedomain.com/[category description]/
I think I figured out my first question in reference to defaulting to the module default event.
In ColdBox.cfc I set the defaultEvent="";
Then in ModuleConfig.cfc I set the this.entryPoint = “/” and added the following in routes - {pattern="/", handler=“Home”, action=“index”}
The next issue I’m having problem is when I do the following - somedomain.com[category description]
I added the following in the ModuleConfig.cfc for the routes but I still keep getting not a valid registered event error.
Brad,
Thank you. The code from ContentBox pointed me in the right direction. It was appending addRoute to force the module to take over the application while adding a prefix to the parent application.