How to access Cloudflare Pages environment variable in Vike app #12
Unanswered
jasonhilldm
asked this question in
Q&A
Replies: 2 comments 1 reply
-
It seems to be a vike-cloudflare question @magne4000. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I suggested that you take a look at https://batijs.dev/, and generate a boilerplate with Cloudflare, Drizzle, Lucia-auth, Trpc, and Hono. You will see that:
You can then take inspiration of the different patterns to adapt your code. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using the Cloudflare adapter for Vike (vike-cloudflare) to build and deploy a small test app to Cloudflare Pages. The app uses Hono and Prisma to access a PostgreSQL database. I have stored the database URL in an environment variable in CF Pages but I don't know how to access that from within the Vike app.
Codes samples for CF Workers show this pattern for accessing the environment variables:
I am not creating a worker specifically though, so don't have that env parameter that is being passed into the fetch function above. Is there some other way to access the environment variables in CF Pages?
Beta Was this translation helpful? Give feedback.
All reactions