From b186a40103f3071ce0631017202f0f0a72858e85 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 7 Oct 2022 21:55:20 -0500 Subject: [PATCH] COnfig? --- config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 config.ts diff --git a/config.ts b/config.ts new file mode 100644 index 0000000..cc45973 --- /dev/null +++ b/config.ts @@ -0,0 +1,11 @@ +import file from "@/config.json" assert { type: "json" }; + +const defaults: Record unknown]> = { + DATABASE_URL: ["postgresql://postgres:@127.0.0.1:5432/lyricscreen", +}; + +export const envs = Object.entries(defaults).map(([key, default]) => { + const val: string | null = Deno.env.get(key) || null; + if (!val) console.warn(`${key} not set!`); + return val; +});