mapping to /coldbox folder outside of webroot

Hi all –

I’ve got a project with (essentially) the following folder structure:

/coldbox

/wwwroot

So normally I’d go into /wwwroot and run “box server start” from there. However I need a mapping back to that /coldbox folder to get rid of the “Could not find the ColdFusion component or interface coldbox.system.Coldbox” issue.

What’s the easiest way to resolve this?

Thanks,

Nolan

Put a this.mappings[ ‘/coldbox’ ] in your Application.cfc. You can dynamically calculate it to be one dir up from your web root.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

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

Hey Brad,

I think that happens slightly too late in the process though. I’ve got an Application.CFC with this at the top:

…and this.mappings doesn’t happen until later.

(FYI, this is an older ColdBox app from a new (to me) client. The ColdBox framework is circa 2006.)

-nolan

Ahh yes, the inheritance approach is incompatible with application-specific mappings. You have two options:

  1. Switch to the non-inheritance approach in your Application.cfc (a bit more boilerplate). https://coldbox.ortusbooks.com/content/full/configuration/bootstrapper.html#composition
  2. Create a server-level mapping for /coldbox

I personally opt for number 1 since it makes my apps more portable and I can have more than one ColdBox app running on the same server, each with a potentially different version of ColdBox installed and they won’t conflict.

Thanks!

~Brad

ColdBox/CommandBox Developer Advocate
Ortus Solutions, Corp

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

Thanks, Brad. That’s what I was missing.

-nolan