Comments (9)
@hiren004 check what URLs are you calling, and what should be URLs in routes/api.php
file, also check your .env
file for APP_URL
. Also check what is your /public
folder. Probably one of these settings are not correct so API is calling different URL than it should.
from laravel-vue-first-crud.
Hello @PovilasKorop Thanks for you fast reply!
In my APP_URL=http://my_ip_address/hiren-work/Laravel-Vue-First-CRUD/public/
Nothing changed any of code in routes/api.php
file or any else also in the whole code.
Don't know why it's not working!
Thank you!!
from laravel-vue-first-crud.
@hiren004 your APP_URL should not contain /public/
from laravel-vue-first-crud.
@PovilasKorop I've remove /public/
but still not call any api.
It'll take the path like: http://my_ip_address/api/v1/companies
instead of http://my_ip_address/hiren-work/Laravel-Vue-First-CRUD/api/v1/companies
from laravel-vue-first-crud.
@hiren004 oh because our app assumes you don't have any subfolders, that your main URL is ip address or domain. The call is done from root folder: axios.post('/api/v1/companies
from laravel-vue-first-crud.
Hello @PovilasKorop Then what is the solution to fix this??
Thank you!
from laravel-vue-first-crud.
@hiren004 1. put the files in the main folder change your URL to just http://my_ip_address
2. or change the Vue code to be more flexible and take your URL prefix, we won't do that for you sorry
from laravel-vue-first-crud.
Hello, Thanks.
Let me try to make it fixed!
Anyway, thank you for co-operate!! Much appreciated! :)
from laravel-vue-first-crud.
For any one who is passing by looking for solution:
if we remove the first / in the request url , it will work. For example when creating companies we send post ajax request to URL /api/v1/companies it will cause 404 but if we use api/v1/companies ajax request will be sent to correct URL
Still checking with it Will post an update if face any issue
from laravel-vue-first-crud.
Related Issues (8)
- The old SQL error for index key too long HOT 1
- https://github.com/sass/node-sass/releases/download/v4.8.3/win32-x64-64_binding.node HOT 1
- Could not load companies HOT 10
- The view isn't right HOT 2
- view component dont load HOT 8
- 401 Unauthorized HOT 4
- views in the resource folder not necessary? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-vue-first-crud.