From 8769cfcee8bf506cfbe151d6abc2efc7b78055d7 Mon Sep 17 00:00:00 2001 From: CalumTowers Date: Sat, 24 Feb 2024 13:09:13 +0000 Subject: [PATCH] feat: URL for VATSIM.net Webhooks --- .env.example | 2 ++ config/services.php | 6 ++++++ routes/web-external.php | 21 +++++++++++++++++++++ routes/web.php | 4 ++++ 4 files changed, 33 insertions(+) create mode 100644 routes/web-external.php diff --git a/.env.example b/.env.example index ecb4e77805..8f63f0dcac 100644 --- a/.env.example +++ b/.env.example @@ -76,6 +76,8 @@ VATSIM_OAUTH_SCOPES=full_name,email,vatsim_details,country VATSIM_API_KEY= VATSIM_API_BASE=https://apiv2.vatsim.dev/v2/ +VATSIM_NET_WEBHOOK_KEY= + #VATSIM_DATA_FEED= MAPS_API_KEY= diff --git a/config/services.php b/config/services.php index 25e550b11c..21b435d350 100644 --- a/config/services.php +++ b/config/services.php @@ -98,4 +98,10 @@ 'oauth_issuer_id' => env('MOODLE_OAUTH_ISSUER_ID'), ], + 'vatsim-net' => [ + 'webhook' => [ + 'key' => env('VATSIM_NET_WEBHOOK_KEY'), + ], + ], + ]; diff --git a/routes/web-external.php b/routes/web-external.php new file mode 100644 index 0000000000..c7f8d8317d --- /dev/null +++ b/routes/web-external.php @@ -0,0 +1,21 @@ + 'external', + 'as' => 'external.', +], function () { + + Route::group([ + 'prefix' => 'vatsim-net', + 'as' => 'vatsim-net.', + ], function () { + + Route::get('webhook', function () { + return response()->json([ + 'status' => 'ok', + ]); + })->name('webhook'); + + }); + +}); diff --git a/routes/web.php b/routes/web.php index 53d46da69d..5026194883 100644 --- a/routes/web.php +++ b/routes/web.php @@ -11,3 +11,7 @@ Route::group(['domain' => config('app.url')], function () { require base_path('routes/web-admin.php'); }); + +Route::group(['domain' => config('app.url')], function () { + require base_path('routes/web-external.php'); +});