Ligonsker's avatar

How to change APP_URL port for Vite?

Hello, I started using Vite in testing and I noticed that the npm run dev command shows:

 ➜  APP_URL: http://localhost:8000

Now hot reload won't work because I run my local server on port 80, using php artisan serve --port=80

I managed to make it work by adding --host to the npm command: npm run dev --host.

Now hot reload works, but I still see:

 ➜  APP_URL: http://localhost:8000

Is there a way to change the default port for npm so that I will both see localhost:80 and also won't need to manually add --host?

Thanks

0 likes
2 replies
Snapey's avatar
Snapey
Best Answer
Level 122

what is your APP_URL set to?

1 like
Ligonsker's avatar

@Snapey Oh! It was APP_URL=http://localhost:80. I have no idea why because I am so used to it being APP_URL=http://localhost by default that I didn't even check. Now after changing that to APP_URL=http://localhost:80 it works! Thanks

Please or to participate in this conversation.