<?php

use App\Http\Controllers\Api\UserController;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;

Route::get('/', function () {
    return Inertia::render('login');
})->name('login');
Route::get('/login', function () {
    return Inertia::render('login');
})->name('login');

Route::post('/login', [UserController::class, 'login'])->name('login');
Route::post('/logout', [UserController::class, 'logout'])->name('logout');

Route::middleware(['auth'])->group(function () {
    Route::get('/app/{any?}', function () {
        return Inertia::render('main');
    })->where('any', '.*')->name('app');
});
