-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.ts
52 lines (45 loc) · 1.21 KB
/
_config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { load } from "@std/dotenv";
import { dirname, fromFileUrl, join } from "@std/path";
import {
collectFeeds,
getCacheDefaults,
getDebug,
getStorage,
} from "./utilities/configHelpers.ts";
import { log } from "./utilities/helpers.ts";
if (Deno.env.get("DENO_ENV") !== "test") {
load();
} else {
console.log("Testing not loading env vars");
}
const appRoot = dirname(fromFileUrl(Deno.mainModule || import.meta.url));
export default (() => {
const storage = getStorage(appRoot);
const feeds = collectFeeds();
const fullConfig = {
debug: getDebug(),
accounts: {
supabase: {
url: Deno.env.get("SUPABASE"),
key: Deno.env.get("SUPABASE_KEY"),
},
// lastFMApi: {
// appKey: Deno.env.get("LASTFM_KEY"),
// appSecret: Deno.env.get("LASTFM_SECRET"),
// },
},
imageprocessor: Deno.env.get("IMAGE_PROCESSOR") || "is", // "is", "im"
staticDirectory: join(
appRoot,
"static",
),
...feeds,
...storage,
...getCacheDefaults(storage),
defaultStorage: Deno.env.get("DEFAULT_STORAGE") || "local",
};
if (getDebug()) {
console.log("Full application configuration:", fullConfig);
}
return fullConfig;
})();