Make Module To Be Default Handler

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]/

http://somedomain.com/[production name]/

Not sure if the above example is possible using Routing alone.

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.

{pattern="/categories/:category_desc", handler=“Search”, action=“index”},

Any ideas what I’m doing wrong?

Jae

You can look at how ContentBox does this to get a lot of help. Check out the ModuleConfig.cfc in the contentbox-ui module.

https://github.com/Ortus-Solutions/ContentBox/blob/master/modules/contentbox-ui/ModuleConfig.cfc#L39

Also here are the docs for module routes:

http://wiki.coldbox.org/wiki/Modules.cfm#SES_Default_Route_Execution

In your error you mentioned, what event is it looking for?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

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.