Skip to content

Commit 5e8f26d

Browse files
authored
Merge pull request #7 from WillyReyno/configurable-uri
Allow URI to be changed through ENV variable
2 parents 80815cc + 73b7ea4 commit 5e8f26d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

config/graphqlite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
'controllers' => 'App\\Http\\Controllers',
2020
'types' => 'App\\',
2121
'debug' => Debug::RETHROW_UNSAFE_EXCEPTIONS,
22-
'uri' => '/graphql',
22+
'uri' => env('GRAPHQLITE_URI', '/graphql'),
2323
];

src/routes/routes.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
<?php
22

3-
$uri = config('graphqlite.uri', '/graphql');
4-
5-
Route::get($uri, 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
6-
Route::post($uri, 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
3+
Route::get(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');
4+
Route::post(config('graphqlite.uri', '/graphql'), 'TheCodingMachine\\GraphQLite\\Laravel\\Controllers\\GraphQLiteController@index');

0 commit comments

Comments
 (0)