在localhost使用的时候我是php artisan serve和npm run watch,url('/')的输出是http:// localhost:8000

问题描述 投票:0回答:1

在localhost使用时

php artisan serve 

npm run watch

url('/')的输出是http://localhost:8000,但我认为当浏览器的adderesbar是http://localhost:3000时它应该是http://localhost:3000

php laravel laravel-mix
1个回答
1
投票

npm run watch正在寻找您的资产文件的更改,以便混合重建它们。

php artisan serve是启动php服务器的原因。文档表明它将在端口8000上启动内置的php Local Development Server:https://laravel.com/docs/5.7/installation

就PHP脚本而言,这就是请求到达它的方式,这就是url('/')返回http://localhost:8000的原因。

© www.soinside.com 2019 - 2024. All rights reserved.