Run cors middleware for testing routes

This commit is contained in:
Lance Pioch 2022-10-29 03:17:23 -04:00
parent 9592ba6cc4
commit aa0b93e16b
3 changed files with 14 additions and 11 deletions

View file

@ -7,7 +7,6 @@ jobs:
env:
APP_URL: "http://127.0.0.1:8000"
APP_ENV: dusk
APP_CORS_ALLOWED_ORIGINS: "*"
DB_USERNAME: root
DB_PASSWORD: root
MAIL_MAILER: log

View file

@ -90,6 +90,7 @@ class Kernel extends HttpKernel
'auth' => Authenticate::class,
'auth.basic' => AuthenticateWithBasicAuth::class,
'auth.session' => AuthenticateSession::class,
'cors' => HandleCors::class,
'guest' => RedirectIfAuthenticated::class,
'csrf' => VerifyCsrfToken::class,
'throttle' => ThrottleRequests::class,

View file

@ -118,6 +118,8 @@ class RouteServiceProvider extends ServiceProvider
return;
}
Route::middleware('cors')->group(function () {
// Simulate Node Ping
Route::get('/api/system', fn () => [
'version' => '1.7.0',
@ -129,5 +131,6 @@ class RouteServiceProvider extends ServiceProvider
// Simulate Successful Server Creation
Route::post('/api/servers', fn () => []);
});
}
}