funcional a parte de token

This commit is contained in:
2026-05-19 16:49:40 -05:00
parent edc6e6486b
commit fcbafce44c
17 changed files with 102 additions and 2202 deletions

View File

@@ -1,6 +1,5 @@
<?php
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\GameController;
@@ -16,21 +15,8 @@ Route::prefix('v1')->middleware(['jwt.auth'])->group(function () {
Route::get('/rankings/weekly', [GameController::class, 'weeklyRanking']);
Route::get('/rankings/monthly', [GameController::class, 'monthlyRanking']);
Route::get('/rankings/yearly', [GameController::class, 'yearlyRanking']);
Route::get('/rankings/history', [GameController::class, 'historyByQuery']);
Route::get('/rankings/history/{id}', [GameController::class, 'history']);
Route::get('/rankings/platforms/{platform}', [GameController::class, 'platformRanking']);
// Jogos
Route::get('/games', [GameController::class, 'index']);
Route::get('/games/most-played', [GameController::class, 'mostPlayed']);
});
Route::get('/health', function () {
return response()->json(['status' => 'ok']);
});
Route::middleware(['jwt.auth'])->get('/test-auth', function (Request $request) {
return response()->json([
'userId' => $request->attributes->get('auth')['id']
]);
});

View File

@@ -1,24 +1 @@
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::redirect('/games/most-played', '/api/v1/games/most-played');
Route::get('/health', function () {
return response('ok', 200);
});