diff --git a/src/config.ts b/src/config.ts index 69d0057..dcdc3f8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,4 +1,11 @@ -import { nip19, secp } from '@/deps.ts'; +import { dotenv, nip19, secp } from '@/deps.ts'; + +/** Load environment config from `.env` */ +await dotenv.load({ + export: true, + defaultsPath: null, + examplePath: null, +}); /** Application-wide configuration. */ const Conf = { diff --git a/src/deps.ts b/src/deps.ts index fe6398b..800a669 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -50,3 +50,4 @@ export { generateSeededRsa } from 'https://gitlab.com/soapbox-pub/seeded-rsa/-/r export * as secp from 'npm:@noble/secp256k1@^1.7.1'; export { LRUCache } from 'npm:lru-cache@^10.0.0'; export { DB as Sqlite } from 'https://deno.land/x/sqlite@v3.7.0/mod.ts'; +export * as dotenv from 'https://deno.land/std@0.197.0/dotenv/mod.ts'; diff --git a/src/server.ts b/src/server.ts index a479b27..76cbc9f 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,5 +1,3 @@ -import 'https://deno.land/std@0.197.0/dotenv/load.ts'; - import app from './app.ts'; Deno.serve(app.fetch);