Remove heuristics finding "lib", "bin", etc.
This causes unneeded hidden behavior ("action at a distance") and makes it difficult to separate application code form application directory.
We really don't need it.
The following is (I think) an example of this problem. Given an app structured like this:
./bin/app.pl
./public/images/secret.jpg
Visiting the page http://<hostname>:3000/images/secret.jpg returns a 404, but moving ./bin/app.pl to just ./app.pl it works as expected.
Are the heuristics still present? Does #919 cover this issue, so it can be closed? When you get a moment, thanks.
@andrewsolomon the example works correctly for me with a current Dancer2 version.
These heuristics are currently in ::Role::ConfigLoader. #919 doesn't cover it.
Thanks for leading me to this. I had a look at Core/Role/ConfigReader.pm Is the problem in sub _build_config_files line 106 where it makes a list of possible config files in various locations then sorts them? I think this is more complicated than it needs to be, and sure to trip me up. But any changes to this could break existing apps.
Suggest: in sub load_config_file we need a debug option to dump the list of files. Perhaps at line 203 or thereabouts. And at line 121, dump $path.
And maybe deprecate this module in favour of a simpler one?
Ideally, #1032 was supposed to help address this, but we never made it further than creating the .dancer file.
#1593 was created to address dumping the list of config files, and #1580 exists to help us remember why we created the .dancer file at all.
Config, in general, needs some love, and I am hoping to get there soon. Stay tuned.