MrBobDaisy
Nuxt site deployed on Cloudflare Pages suddenly having issues loading?
My site hosted on Cloudflare pages is suddenly not loading properly. No changes have been made and the last deployment was nearly 30 days ago.
I set up pages rules today thinking redirects are the issue (wasn't using 301 for HTTP -> HTTPS or WWW -> non-WWW). So far it seems iffy if the propagation is loading properly. Once the browser caches, it seems to be okay? But the minute I test in another browser or on mobile I have a loading issue again. Once it finally loads, I get a 404 page. If I clear errors, I can then see the homepage again. The site in question: laborstaffers.com
I set up pages rules today thinking redirects are the issue (wasn't using 301 for HTTP -> HTTPS or WWW -> non-WWW). So far it seems iffy if the propagation is loading properly. Once the browser caches, it seems to be okay? But the minute I test in another browser or on mobile I have a loading issue again. Once it finally loads, I get a 404 page. If I clear errors, I can then see the homepage again. The site in question: laborstaffers.com
5 replies
Server directory API call will only work with 127.0.0.1
Making an API call to GraphQL only works with a hardcoded IP and port number.
CMS is using ddev to run the docker container. If we set the URL to
https://[sitedomain].ddev.site/api
or http://localhost:[portnumber]/api
we cannot connect to the API through the server directory. Making the call client side works without issue. Only error from Nuxt is fetch failed
. Below is the server API call using Apollo Client, but useFetch gives the same errors.
2 replies
Use external ApiS in Nuxt?
Not sure I'm 100% understanding how to handle external APIs in Nuxt. I need to store a secret key in the .env file and access it later, and make additional queries based on a search from the user. Currently I have a
server/api/jobs.js
file that holds the initial query, which works great for the initial render. But I'm trying to search for jobs at a different URL in the API call with a query param, set up as server/api/searchCityJobs.js
right now.
I was doing this in the component previously for testing purposes, but I obviously don't want to expose the private API key. Does anyone have any insight into this?13 replies