vue应用程序在里面:C:\xampp\htdocs\booking
Laravel api在里面:C:\xampp\htdocs\booking-api
仅供参考:vue应用程序正在100上运行
如果文件夹 struct 如上图所示,那么应用程序运行良好,我可以这样调用api,
axios.get('http://localhost/booking-api/public/Rooms').then((response)=>this.items = response.data);
但我想在booking
文件夹中放入booking-api
文件夹.如果我放置它并调用下面的api,
axios.get('/booking-api/public/Rooms').then((response)=>this.items = response.data);
它不会工作控制台窗口是这样的,
Request URL:http://localhost:8080/booking-api/public/Rooms
Request Method:GET
Status Code:404 Not Found
那么,我如何在vue
应用程序中放置api
个项目,以及如何从vue调用api.