mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
allow weather apis to use hidden api keys
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { join } from "path";
|
||||
import { existsSync, copyFile } from "fs";
|
||||
import { promises as fs } from "fs";
|
||||
import path from "path";
|
||||
import yaml from "js-yaml";
|
||||
|
||||
export default function checkAndCopyConfig(config) {
|
||||
const configYaml = join(process.cwd(), "config", config);
|
||||
@@ -14,3 +17,11 @@ export default function checkAndCopyConfig(config) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export async function getSettings() {
|
||||
checkAndCopyConfig("settings.yaml");
|
||||
|
||||
const settingsYaml = path.join(process.cwd(), "config", "settings.yaml");
|
||||
const fileContents = await fs.readFile(settingsYaml, "utf8");
|
||||
return yaml.load(fileContents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user