I have a project that displays and pulls data perfectly fine in localhost but when I go to deploy via vercel / nextjs it is finding the data as undefined because it doesn't have permission to access the API. How would I grant access to vercel if the deployment stage doesn't have an accessible URL in the format of: protocol://hostname [:port] ?
Aug 12, 2022, 7:25 PM
A few things to check here:1. If your dataset is private you will need to use a token when querying. 2. You can add your vercel domain to your CORS origins like this:
Aug 12, 2022, 7:31 PM
I got it working, thank you. I apparently had the server, vercel, and API setup working fine, but I had to predefine each part of my groq query before I returned it in my JSX. Just took a little experimentation. I appreciate the help, thank you 🙂