cody
cody
CCConvex Community
Created by Eva on 9/5/2024 in #support-community
Setting up a custom domain
Thanks for sharing this So, are you setting the convex url to the cloudflare preview deployment secrets via api in the github action?
28 replies
CCConvex Community
Created by Eva on 9/5/2024 in #support-community
Setting up a custom domain
Hi @Eva – I'm trying to get convex preview deployments set up with cloudflare pages right now and it's not working out so far. Were you able to get it working? @sshader As far as I know, env variables set using vite are not available in cloudflare pages deployments. Variables can be set in the wrangler.toml or the cloudflare dashboard, then they're available on the server. I'm using remix, so I access them in loaders/actions:
export async function loader(args: LoaderFunctionArgs) {
const env = args.context.cloudflare.env

return env
}
export async function loader(args: LoaderFunctionArgs) {
const env = args.context.cloudflare.env

return env
}
In the cloudflare build logs it looks like everything working correctly, a convex preview deployment is created, cloudflare deployment is created, but the app isn't functional because it doesn't have access to the preview CONVEX_URL
28 replies