How can I use endpoint from .env in prisma.yml?
# orm-help
g
How can I use endpoint from .env in prisma.yml?
l
use ${env:YOUR_ENV_VAR} to inject an environment variable in your yaml file
if i remember correctly the syntax
g
but shouldn't I import dotenv or something like that?
l
you will need to load the .env in your environment (on bash: source .env) before executing prisma deploy.
i don't know what dotenv is, but if it does this job, then yes
g
@linkdd i tried how you said but now when I'm trying to use prisma I get this error:
Your token is invalid. It might have expired or you might be using a token from a different project.
l
what is the value of your environment variable and the value of your endpoint field in prisma.yml ?
g
prisma.yml:
Copy code
endpoint: ${env:PRISMA_ENDPOINT}
secret: ${env:PRISMA_SECRET}
I also tried to generate token using
prisma token
and pass it to
query variables
in graphql playground
l
please remove your secret from a public service 😉
g
done 🙂
btw, maybe I did something wrong. As I know, I should come up with secret by myself, right?
l
i don't know, i use prisma locally 😛 regarding the token error i cannot help, maybe someone else can