PSGI entry points (#11632) -- add a plackMiddleware section to the config file; modify share/site.psgi to load from it.
This is minimal in implementation right now in that there's no support for passing args, which would generally be objects mixed with strings, to the middlewares being added, as would be necessary if the .psgi files were to be largely migrated to the config files. I agree that it's important that upgrade scripts be able to add middleware (probably custom ones that know how to get the session from %$env) but I'm not convinced of the utility of moving much logic out of share/site.psgi.
This commit is contained in:
parent
dd6a297c06
commit
2d31f7234a
2 changed files with 52 additions and 0 deletions
|
|
@ -56,6 +56,12 @@ builder {
|
|||
Plack::App::File->new(root => $config->get('uploadsPath'));
|
||||
};
|
||||
|
||||
# enable config defined Middleware
|
||||
|
||||
for my $mw ( @{ $config->get('plackMiddleware') || [] } ) {
|
||||
enable $mw;
|
||||
}
|
||||
|
||||
# Return the app
|
||||
mount '/' => $wg->to_app;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue