Deploy env variables

here’s my website @:
in my code I have a node env variable that I planned to set on netlify deploy panel.
isn’t this the way to do it?
in my code I’m calling : process.env.MY_DB_CONN
and in netlify I created this variable with the @ of my backend
it’s not working. it seems the env variable is undefined

What does that mean exactly?

You should be able to create the EV by using same name: MY_DB_CONN and value as your .env file.

it means the api endpoint

I’ve not use API endpoints myself, so can’t say for sure. But can you trying creating an EV manually in the UI?

I did but it still appears as undefined in production. As a result, prod is trying to access the dev server (localhost)

This might help: [Support Guide] Using environment variables on Netlify correctly

1 Like