DEV Community

Discussion on: Write your first API with Deno

Collapse
 
nikolabosnjak6 profile image
Nikola Bosnjak • Edited

Great post, thanks!

You dont have to expose db credentials, you can do it like this

just import --> import "deno.land/x/denv/mod.ts"; <-- to db.ts file

const dbName = Deno.env.get("DB_NAME") as string;
const dbHostUrl = Deno.env.get("DB_HOST_URL") as string;

Collapse
 
saswatamcode profile image
Saswata Mukherjee

Yup! Can do!