Open bbaltatu opened 1 year ago
You don't need an env when building the server, only when running it. How you configure your environment depends on your server setup. How and where are you running your production server?
The build is as "node-server" (default option) and I am running the the server with "node .output/server/index.mjs
For local testing, if you want to set an environment variable for a single command in the shell (without permanently adding it to your profile or session), you can do it inline, before the command:
SUPABASE_URL=https://yourprojectid.supabase.co SUPABASE_KEY=your_key_here node .output/server/index.mjs
In Windows command prompt:
set VARIABLE_NAME=value && command_to_run
The environment variable will only be set for that single command. It won't affect subsequent commands in the session or other processes. If you need the environment variable in a production environment, you'll probably use PM2 or something.
@Aietes I suppose this issue can be closed? :)
@pascalwengerter Yes, I think so, I hope @bbaltatu got things working. :)
Hi, I try to build files for production by running "npm run build" command . Because I want to send SUPABASE_URL as env variable I don't have an .env file in the moment of building the server. My question is : "How can I build my app and passing SUPABASE_URL when I run the APP?" (I tried a lot of things and nothing worked.
Using NUXT3 latest @nuxtjs/supabase: 1.0.2