Add testing routes

This commit is contained in:
Lance Pioch 2022-10-27 21:45:51 -04:00
parent 660c85aa97
commit 553c4f6b09
2 changed files with 22 additions and 0 deletions

View file

@ -62,6 +62,8 @@ class RouteServiceProvider extends ServiceProvider
->prefix('/api/remote')
->scopeBindings()
->group(base_path('routes/api-remote.php'));
$this->duskBoot();
});
}
@ -107,4 +109,23 @@ class RouteServiceProvider extends ServiceProvider
)->by($key);
});
}
// Node Ping Test Helper
private function duskBoot()
{
if (!app()->environment('dusk')) {
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::post('/api/servers', fn () => []);
}
}

View file

@ -1,5 +1,6 @@
<?php
use Illuminate\Support\Facades\Route;
use Pterodactyl\Http\Controllers\Base;
use Pterodactyl\Http\Middleware\RequireTwoFactorAuthentication;