Added new config.php setting for subdirectory base path (closes #568)

This commit is contained in:
Bernd Bestel
2020-03-06 20:41:00 +01:00
parent c73ce21ef5
commit 8be14768df
3 changed files with 16 additions and 0 deletions

View File

@@ -68,6 +68,12 @@ $container->set('ApiKeyHeaderName', function(Container $container)
// Load routes from separate file
require_once __DIR__ . '/routes.php';
// Set base path if defined
if (!empty(GROCY_BASE_PATH))
{
$app->setBasePath(GROCY_BASE_PATH);
}
// Add default middleware
$app->addRoutingMiddleware();
$app->addErrorMiddleware(true, false, false);