php artisan serve vs. npm run dev - difference between both servers?

Viewed 65

I just started to learn more about Laravel and I am confused about servers. When I run 'php artisan serve' in my project's folder, I can access my web project via localhost:8000. When I run npm run dev I can access via localhost:5173 - but I am not directed to my web project's landing page but to the welcome page of Laravel Vite. For me running 'php artisan serve' is the right option. So, now to my question(s): Did I do some kind of misconfiguration when setting up the project? Where is the difference between those two servers? Thank you for your answers! Robert

1 Answers

Php artisan serve - hosts your project on your local server. And 'npm run dev' command complies vite and it will track and update frontend modifications without reload.

Related