1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-17 18:36:39 +02:00

feat(site-plugin): add TrailingSlash Middlewares

This commit is contained in:
Awilum
2020-02-11 17:02:49 +03:00
parent 1c75fc4a83
commit 4befc6e5d3
3 changed files with 25 additions and 1 deletions

View File

@@ -38,3 +38,8 @@ include_once 'routes/web.php';
* Include dependencies
*/
include_once 'dependencies.php';
/**
* Include Middlewares
*/
include_once 'middlewares.php';

View File

@@ -16,7 +16,9 @@
"issues": "https://github.com/flextype/issues"
},
"require": {
"php": ">=7.2.0"
"php": ">=7.2.0",
"ext-json": "*",
"middlewares/trailing-slash": "~1.1.0"
},
"config": {
"apcu-autoloader": true,

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
/**
* Flextype (http://flextype.org)
* Founded by Sergey Romanenko and maintained by Flextype Community.
*/
namespace Flextype;
use Middlewares\TrailingSlash;
/**
* Add middleware TrailingSlash for all routes
*/
$app->add((new TrailingSlash(false))->redirect(true));