<?php

use Illuminate\Support\Facades\Route;

// Named `login` route so Laravel's Authenticate middleware can resolve route('login')
// when an unauthenticated /api/* request needs a redirect URL. The SPA shell handles
// the actual login flow client-side; this route just exists so the framework can
// generate the URL without throwing.
Route::get('/login', function () {
    return response()->file(public_path('index.html'));
})->name('login');

Route::get('/', function () {
    return response()->file(public_path('index.html'));
});

Route::get('/{any}', function () {
    return response()->file(public_path('index.html'));
})->where('any', '^(?!api|test).*');
