Giter VIP home page Giter VIP logo

Comments (9)

PovilasKorop avatar PovilasKorop commented on July 26, 2024

@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.

hiren004 avatar hiren004 commented on July 26, 2024

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.

PovilasKorop avatar PovilasKorop commented on July 26, 2024

@hiren004 your APP_URL should not contain /public/

from laravel-vue-first-crud.

hiren004 avatar hiren004 commented on July 26, 2024

@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.

PovilasKorop avatar PovilasKorop commented on July 26, 2024

@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.

hiren004 avatar hiren004 commented on July 26, 2024

Hello @PovilasKorop Then what is the solution to fix this??

Thank you!

from laravel-vue-first-crud.

PovilasKorop avatar PovilasKorop commented on July 26, 2024

@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.

hiren004 avatar hiren004 commented on July 26, 2024

Hello, Thanks.

Let me try to make it fixed!

Anyway, thank you for co-operate!! Much appreciated! :)

from laravel-vue-first-crud.

simplysaif avatar simplysaif commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.