I’m trying to get web aliases to work so that I can run testbox tests, but I’m not succeeding. I am using CommandBox CLI 6.1.0+813 and tested with Lucee 6.1.1.118 and Lucee 5.4.6.9.
I have an app that has this basic folder structure:
> project_root
> tests
> Application.cfc
> runner.cfm
> wwwroot
> Application.cfc
> index.cfm
> server.json
My server.json
file has this basic setup:
{
"web":{
"aliases":{
"/tests":"tests",
"/sameAsWwwRoot":"wwwroot"
},
"bindings":{
"HTTP":{
"listen":"80"
}
},
"webroot":"wwwroot"
}
}
When starting a server with debug
mode, it indicates that the aliases are loading and evaluating to the correct folders.
- “/tests” → “project_root/tests”
- “/sameAsWwwRoot” → “project_root/wwwroot”
When I navigate to http://localhost/index.cfm
, the “project_root/wwwroot/index.cfm” page loads as expected.
But when I navigate to http://localhost/tests/runner.cfm
, the following error occurs:
Missing Includes
Page [/tests/runner.cfm] [system-path\project_root\wwwroot\tests\runner.cfm] not found
And when I navigate to http://localhost/sameAsWwwRoot
, a similar error occurs:
Missing Includes
Page [/sameAsWwwRoot/index.cfm] [system-path\project_root\wwwroot\sameAsWwwRoot\index.cfm] not found
I’ve noticed that the “modern” ColdBox starter template also is failing TestBox runs because of the same problem.
Does anybody have any suggestions on how to get this working?
This almost looks like a candidate for using multiple “sites”, but I’m not sure what kind of overhead that creates compared to aliases.