Various files

This commit is contained in:
James Cole
2017-09-09 22:10:43 +02:00
parent b219283d66
commit 2268155994
3 changed files with 52 additions and 56 deletions

View File

@@ -1,25 +1,10 @@
<?php <?php
/**
* RouteServiceProvider.php
* Copyright (C) 2016 thegrumpydictator@gmail.com
*
* This software may be modified and distributed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* See the LICENSE file for details.
*/
declare(strict_types=1);
namespace FireflyIII\Providers; namespace FireflyIII\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
/**
* Class RouteServiceProvider
*
* @package FireflyIII\Providers
*/
class RouteServiceProvider extends ServiceProvider class RouteServiceProvider extends ServiceProvider
{ {
/** /**
@@ -50,31 +35,11 @@ class RouteServiceProvider extends ServiceProvider
*/ */
public function map() public function map()
{ {
$this->mapWebRoutes();
$this->mapApiRoutes(); $this->mapApiRoutes();
// $this->mapWebRoutes();
}
/** //
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::group(
[
'middleware' => 'api',
'namespace' => $this->namespace,
'prefix' => 'api',
], function ($router) {
require base_path('routes/api.php');
}
);
} }
/** /**
@@ -86,13 +51,23 @@ class RouteServiceProvider extends ServiceProvider
*/ */
protected function mapWebRoutes() protected function mapWebRoutes()
{ {
Route::group( Route::middleware('web')
[ ->namespace($this->namespace)
'middleware' => 'web', ->group(base_path('routes/web.php'));
'namespace' => $this->namespace, }
], function ($router) {
require base_path('routes/web.php'); /**
} * Define the "api" routes for the application.
); *
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
} }
} }

View File

@@ -1,15 +1,13 @@
<?php <?php
/** /**
* index.php * Laravel - A PHP Framework For Web Artisans
* Copyright (C) 2016 thegrumpydictator@gmail.com
* *
* This software may be modified and distributed under the terms of the * @package Laravel
* Creative Commons Attribution-ShareAlike 4.0 International License. * @author Taylor Otwell <taylor@laravel.com>
*
* See the LICENSE file for details.
*/ */
declare(strict_types=1); define('LARAVEL_START', microtime(true));
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -19,11 +17,11 @@ declare(strict_types=1);
| Composer provides a convenient, automatically generated class loader for | Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it | our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual | into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels nice to relax. | loading any of our classes later on. It feels great to relax.
| |
*/ */
require __DIR__ . '/../bootstrap/autoload.php'; require __DIR__.'/../vendor/autoload.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@@ -37,7 +35,7 @@ require __DIR__ . '/../bootstrap/autoload.php';
| |
*/ */
$app = require_once __DIR__ . '/../bootstrap/app.php'; $app = require_once __DIR__.'/../bootstrap/app.php';
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

23
public/web.config Normal file
View File

@@ -0,0 +1,23 @@
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>