Closed antoine3000 closed 6 months ago
Hi there!
Nuxt runs on localhost:3000
. If you point the KIRBY_BASE_URL
environment variable to the same hostname, Nuxt will try to fetch Kirby data from itself. Instead, you need to point to your backend instance. Depending on if you use Valet, composer start
the URL will be something like http://cacao-kit-backend.test
or http://localhost:8000
, respectively.
Take this demo configuration as an example:
NUXT_PUBLIC_SITE_URL=http://localhost:3000
KIRBY_BASE_URL=http://cacao-kit-backend.test
KIRBY_API_TOKEN=test
Edit: Updated the config to match your setup.
Ay, makes sense, many thanks!
Hi Johann,
First of all, thank you so much for the work you do for the Kirby community, I really appreciate it!
I wanted to try a fresh install of the Cacao kit on my local machine and start developing from there before pushing everything to the remote. Unfortunately, I can't get it to work and reading the docs doesn't help my case.
Both should be accessible in the browser as cacao-kit-frontend.test and cacao-kit-backend.test.
In the frontend, my .env looks like this:
And for the backend, my .env looks like this:
I was expecting it to work from there, but it doesn't. Could you give me some guidance on how to make it work locally? Thanks a lot, Antoine