0

I start a new project on glitch.com, and add a variable and value in .env

Plaintext shows: SECRET=beNice (no quotes)

console.log(process.env.SECRET) shows: process is not defined

How can I call these variables?

https://glitch.com/edit/#!/important-chambray-liquid

1 Answer 1

1

Environment variables can only be accessed on the server side of an app, not on the client side as your static site linked there currently is trying to do.

For an example of an app with server side code accessing the environment, you can see in the Glitch node app starter that it's accessing the PORT variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.