<?php

use App\Http\Controllers\Api\LauncherAuthController;
use App\Http\Controllers\Api\LauncherController;
use App\Http\Controllers\Api\LauncherNewsController;
use Illuminate\Support\Facades\Route;

Route::post('launcher/login', [LauncherAuthController::class, 'login'])
    ->middleware('throttle:10,1');

Route::middleware('auth:api')->prefix('launcher')->group(function () {
    Route::get('manifest', [LauncherController::class, 'manifest']);
    Route::get('download/{path}', [LauncherController::class, 'download'])
        ->where('path', '.*');
    Route::get('news', [LauncherNewsController::class, 'index']);
});

Route::middleware(['launcher'])->prefix('service')->name('service.')->group(function () {
    Route::post('/update-appcast', [LauncherController::class, 'updateAppcast']);
});
