-1

I have an application which I'd like to deploy to heroku. I have already created the application in heroku and added the deno buildpack. I have also set up the databse using psql and created the tables. Now the only problem is I don't know how to write or use the .env file so that the Deno application can access the correct database credentials.

MatiasC
  • 27
  • 3
  • Does this answer your question? [How to add .env file or otherwise set environment variables in a Heroku app?](https://stackoverflow.com/questions/49905070/how-to-add-env-file-or-otherwise-set-environment-variables-in-a-heroku-app) – ChrisGPT was on strike Dec 12 '20 at 16:13
  • you have been asked, if the linked answer answers your question. You can click on "yes, it answers my question" or something like this to confirm or edit you question and explain why it's not the case. – jps Dec 13 '20 at 14:07

1 Answers1

0

https://deno.land/x/dotenv@v2.0.0
this extension will help you.

If you want to use env with Deno:

import "https://deno.land/x/dotenv/load.ts";

console.log(Deno.env.get('GREETING'));

Another way:

// app.ts
import { config } from "https://deno.land/x/dotenv/mod.ts";

console.log(config());
Morani
  • 446
  • 5
  • 15