mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Everything configured to generate routes from CLI
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
use Acelaya\UrlShortener\Middleware\CliRoutable;
|
||||
|
||||
return [
|
||||
|
||||
'routes' => [
|
||||
[
|
||||
'name' => 'cli',
|
||||
'path' => '/command-name',
|
||||
'middleware' => function ($req, $resp) {
|
||||
|
||||
},
|
||||
'name' => 'cli-generate-shortcode',
|
||||
'path' => '/generate-shortcode',
|
||||
'middleware' => CliRoutable\GenerateShortcodeMiddleware::class,
|
||||
'allowed_methods' => ['CLI'],
|
||||
],
|
||||
],
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
return [
|
||||
|
||||
'routes' => [
|
||||
[
|
||||
'name' => 'home',
|
||||
'path' => '/',
|
||||
'middleware' => function ($req, $resp) {
|
||||
|
||||
},
|
||||
'allowed_methods' => ['GET'],
|
||||
],
|
||||
// [
|
||||
// 'name' => 'home',
|
||||
// 'path' => '/',
|
||||
// 'middleware' => '',
|
||||
// 'allowed_methods' => ['GET'],
|
||||
// ],
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
use Acelaya\UrlShortener\Factory\CacheFactory;
|
||||
use Acelaya\UrlShortener\Factory\EntityManagerFactory;
|
||||
use Acelaya\UrlShortener\Middleware;
|
||||
use Acelaya\UrlShortener\Service\UrlShortener;
|
||||
use Acelaya\ZsmAnnotatedServices\Factory\V3\AnnotatedFactory;
|
||||
use Doctrine\Common\Cache\Cache;
|
||||
@@ -19,12 +20,11 @@ return [
|
||||
'factories' => [
|
||||
Application::class => Container\ApplicationFactory::class,
|
||||
|
||||
// Routes
|
||||
// Url helpers
|
||||
Helper\UrlHelper::class => Helper\UrlHelperFactory::class,
|
||||
Helper\ServerUrlMiddleware::class => Helper\ServerUrlMiddlewareFactory::class,
|
||||
Helper\UrlHelperMiddleware::class => Helper\UrlHelperMiddlewareFactory::class,
|
||||
Helper\ServerUrlHelper::class => InvokableFactory::class,
|
||||
Router\RouterInterface::class => InvokableFactory::class,
|
||||
Router\AuraRouter::class => InvokableFactory::class,
|
||||
|
||||
// View
|
||||
@@ -36,10 +36,14 @@ return [
|
||||
GuzzleHttp\Client::class => InvokableFactory::class,
|
||||
UrlShortener::class => AnnotatedFactory::class,
|
||||
Cache::class => CacheFactory::class,
|
||||
|
||||
// Middleware
|
||||
Middleware\CliRoutable\GenerateShortcodeMiddleware::class => AnnotatedFactory::class,
|
||||
],
|
||||
'aliases' => [
|
||||
'em' => EntityManager::class,
|
||||
'httpClient' => GuzzleHttp\Client::class,
|
||||
Router\RouterInterface::class => Router\AuraRouter::class,
|
||||
]
|
||||
],
|
||||
|
||||
|
||||
9
config/autoload/url-shortener.global.php
Normal file
9
config/autoload/url-shortener.global.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
return [
|
||||
|
||||
'url-shortener' => [
|
||||
'schema' => getenv('SHORTENED_URL_SCHEMA') ?: 'http',
|
||||
'hostname' => getenv('SHORTENED_URL_HOSTNAME'),
|
||||
],
|
||||
|
||||
];
|
||||
Reference in New Issue
Block a user