Server side environment variables in production?
I'm trying to use
node-server
to serve my application. In DEV, all my environment variables (like DATABASE_URL) are working fine. When I go to serve with node ./.output/server/index.mjs
, none of my server environment variables are there. Is there a common solution for this? I'm on 1.121.21
1 Reply
probable-pinkOP•3mo ago
Seems like my Node polyfill was causing some issues.
Running
vite build
and then node --env-file=.env .output/server/index.mjs
works!