Provide basePath support (#309)
* Provide basePath support To be able to serve the application via a reverse proxy in a subfolder smarty needs to be aware of the basepath if any. * Provide basepath support via X-Forwarded headers * Fix warnings * Review adjustments * Provide support X-Forwarded-Host header * Use $uri in view factory directly * Use middleware to set basepath from X-Forwarded-Path header * Fix invalid type hint in RouterPathMiddleware * Add "X-Forwarded-Host" to README
This commit is contained in:
parent
234ecc2c6d
commit
c5298dd24b
4 changed files with 71 additions and 2 deletions
|
@ -10,6 +10,7 @@ use Alltube\ErrorHandler;
|
|||
use Alltube\LocaleManagerFactory;
|
||||
use Alltube\LocaleMiddleware;
|
||||
use Alltube\LoggerFactory;
|
||||
use Alltube\RouterPathMiddleware;
|
||||
use Alltube\ViewFactory;
|
||||
use Slim\App;
|
||||
use Slim\Container;
|
||||
|
@ -31,7 +32,9 @@ try {
|
|||
|
||||
// Locales.
|
||||
$container['locale'] = LocaleManagerFactory::create();
|
||||
|
||||
$app->add(new LocaleMiddleware($container));
|
||||
$app->add(new RouterPathMiddleware($container));
|
||||
|
||||
// Smarty.
|
||||
$container['view'] = ViewFactory::create($container);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue