Open mallochine opened 10 years ago
I could submit code for this issue, if someone would greenlight me to do so.
If you don't have an instance of the root application, wouldn't it make more sense to create an application and merge your root into that as the new root?
bottle.merge(...) doesn't make sense because you're not, technically, merging two applications together, you're bootstrapping them into the same space.
Yes, bootstrapping them into the same space is exactly what's being attempted. And yes, it would make more sense to have a root instance, instead of a root app. On the other hand, the codebase I'm working with has a large root application, so appending "root." to everything is 1) tedious, and 2) hard to test.
It took just 2 lines of code to bootstrap another app into the same space. I think that would be the preferred way of bootstrapping two apps into the same space.
What about the existing default_app().merge
?
Right now, "merge" exists only if you have an instance, e.g. "root = Bottle(); root.merge(...)"
Sometimes, you don't have a instance. Instead, you'd like to merge another module's app into the root module.
This is the case at the company I'm currently working for. The ideal solution would be to have "bottle.merge(...)", but we currently hvae the following workaround: