Skip to content

Commit

Permalink
Merge pull request thecodingmachine#8 from WillyReyno/web-middleware
Browse files Browse the repository at this point in the history
Add middleware to routes and configurable env variable
  • Loading branch information
moufmouf committed Sep 26, 2019
2 parents 5e8f26d + a27f085 commit 3213e17
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"symfony/psr-http-message-bridge": "^1",
"zendframework/zend-diactoros": "^1.8.6"
},
"require-dev": {
"orchestra/testbench": "^3.5.5 || ^4",
"phpunit/phpunit": "^7.5.4 || ^8.3",
"ext-sqlite3": "*"
},
"autoload" : {
"psr-4" : {
"TheCodingMachine\\GraphQLite\\Laravel\\" : "src/"
Expand All @@ -40,11 +45,6 @@
]
}
},
"require-dev": {
"orchestra/testbench": "^3.5.5",
"phpunit/phpunit": "^7.5.4",
"ext-sqlite3": "*"
},
"minimum-stability": "dev",
"prefer-stable": true
}
1 change: 1 addition & 0 deletions config/graphqlite.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
'types' => 'App\\',
'debug' => Debug::RETHROW_UNSAFE_EXCEPTIONS,
'uri' => env('GRAPHQLITE_URI', '/graphql'),
'middleware' => ['web'],
];
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
</testsuite>
</testsuites>

<php>
<env name="APP_KEY" value="9E6B382F19C53C5327840752500B0260"/>
</php>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
Expand Down
6 changes: 4 additions & 2 deletions src/routes/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php

Route::get(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
Route::post(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
Route::group(['middleware' => config('graphqlite.middleware', ['web'])], function () {
Route::get(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
Route::post(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
});

0 comments on commit 3213e17

Please sign in to comment.