Browse Source

Use new method for retrieving base URL

pull/9/head
Franz Liedke 9 years ago
parent
commit
56fb00378c
  1. 2
      admin.php
  2. 2
      api.php
  3. 2
      index.php

2
admin.php

@ -23,7 +23,7 @@ $admin = new MiddlewarePipe();
$admin->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
$admin->pipe($app->make('Flarum\Admin\Middleware\LoginWithCookieAndCheckAdmin'));
$adminPath = parse_url(Core::config('admin_url'), PHP_URL_PATH);
$adminPath = parse_url(Core::url('admin'), PHP_URL_PATH);
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.admin.routes')]);
$admin->pipe($adminPath, $router);

2
api.php

@ -23,7 +23,7 @@ $api = new MiddlewarePipe();
$api->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
$api->pipe($app->make('Flarum\Api\Middleware\LoginWithHeader'));
$apiPath = parse_url(Core::config('api_url'), PHP_URL_PATH);
$apiPath = parse_url(Core::url('api'), PHP_URL_PATH);
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.api.routes')]);
$api->pipe($apiPath, $router);

2
index.php

@ -27,7 +27,7 @@ if ($app->bound('flarum.config')) {
$flarum->pipe($app->make('Flarum\Forum\Middleware\LoginWithCookie'));
$flarum->pipe($app->make('Flarum\Api\Middleware\ReadJsonParameters'));
$basePath = parse_url(Core::config('base_url'), PHP_URL_PATH);
$basePath = parse_url(Core::url(), PHP_URL_PATH);
$router = $app->make('Flarum\Http\RouterMiddleware', ['routes' => $app->make('flarum.forum.routes')]);
$flarum->pipe($basePath, $router);

Loading…
Cancel
Save