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,16 +118,19 @@ class RouteServiceProvider extends ServiceProvider
return;
}
// Simulate Node Ping
Route::get('/api/system', fn () => [
'version' => '1.7.0',
'kernel_version' => '5.4.0-126-generic',
'architecture' => 'amd64',
'os' => 'linux',
'cpu_count' => 2,
]);
Route::middleware('cors')->group(function () {
// Simulate Successful Server Creation
Route::post('/api/servers', fn () => []);
// Simulate Node Ping
Route::get('/api/system', fn () => [
'version' => '1.7.0',
'kernel_version' => '5.4.0-126-generic',
'architecture' => 'amd64',
'os' => 'linux',
'cpu_count' => 2,
]);
// Simulate Successful Server Creation
Route::post('/api/servers', fn () => []);
});
}
}