<?php

use Illuminate\Support\Facades\Route;

// Catch-all route for SPA
Route::get('/{any}', function () {
    $indexPath = public_path('index.html');
    
    if (file_exists($indexPath)) {
        return file_get_contents($indexPath);
    }
    
    return "Error: index.html no encontrado. Ejecuta 'npm run build'.";
})->where('any', '.*');