From cdcd34fa0f3c4ac06029f4e1d864f098e7914de4 Mon Sep 17 00:00:00 2001 From: Theo Weijmer Date: Wed, 8 Oct 2025 09:13:22 +0200 Subject: [PATCH] Fix for laravel routes --- .claude/settings.local.json | 12 ++++++++++++ backend/routes/web.php | 7 ++++--- frontend/vite.config.js | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .claude/settings.local.json diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..082541e --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,12 @@ +{ + "permissions": { + "allow": [ + "Bash(php artisan route:list:*)", + "Bash(lsof:*)", + "Bash(curl:*)", + "Bash(php:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/backend/routes/web.php b/backend/routes/web.php index 028c537..05fdcf4 100644 --- a/backend/routes/web.php +++ b/backend/routes/web.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; -Route::get('/', function () { - return ['Laravel' => app()->version()]; -}); +// Serve the Vue SPA for all non-API routes +Route::get('/{any}', function () { + return file_get_contents(public_path('index.html')); +})->where('any', '.*'); diff --git a/frontend/vite.config.js b/frontend/vite.config.js index ea4f141..d8e2ddf 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -13,7 +13,7 @@ export default defineConfig({ port: 3000, proxy: { '/api': { - target: 'http://localhost:8000', + target: 'http://localhost:8001', changeOrigin: true, }, },