Setting ModuleRoutes using onLoad in moduleConfig

I take it that I can’t do anything like this?

function onLoad(){
if( controller.settingExists(“sesBaseURL”) ){
var intSES = controller.getInterceptorService().getInterceptor(‘SES’);
intSES.addModuleRoutes(pattern="/forgebox",module=“forgebox”);

this.entryPoint = “forgebox:manager”;
}
}

As it throws the error.

Application Execution ExceptionError Type: HandlerService.EventHandlerNotRegisteredException : [N/A]

Error Messages: The event: forgebox.index is not valid registered event.

remember that SES is in order of entrance, so that means that what you did will add it at the END of the routes, check the routes and most likely you have one that matches before yours. That is why entry point modules routes ahve to be added to the partent routes.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

There are no addModuleRoutes for forgebox until I did what I tried to do.

But I understand what you are saying, and there is also no other forgebox routes either. I was hoping that this method would work but it seems like it won’t.

I think that from that code snippet you are trying to register the module’s routes via the module. You can do it it works, but the default routes in the parent will prevent these routes to ever execute.

That is why positioning them in the parent manually is the only way, UNLESS, you prePend them instead of appending them.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Ok, but if I dont have it in the config.cfc it seems weird, anyway how do you prepend them?