Extraction des secrets
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const { applyEnvOverrides } = require("../config");
|
||||
const { loadEnv } = require("../env");
|
||||
|
||||
const DEFAULT_WEATHER_CONFIG = {
|
||||
timezone: "Europe/Paris",
|
||||
@@ -20,6 +22,8 @@ const DEFAULT_WEATHER_CONFIG = {
|
||||
};
|
||||
|
||||
function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "config.json")) {
|
||||
loadEnv();
|
||||
|
||||
let raw = {};
|
||||
|
||||
if (fs.existsSync(configPath)) {
|
||||
@@ -30,7 +34,8 @@ function loadWeatherConfig(configPath = path.resolve(__dirname, "..", "..", "con
|
||||
}
|
||||
}
|
||||
|
||||
const weather = raw.weather || {};
|
||||
const withEnv = applyEnvOverrides(raw);
|
||||
const weather = withEnv.weather || {};
|
||||
|
||||
const providers = {
|
||||
...DEFAULT_WEATHER_CONFIG.providers,
|
||||
|
||||
Reference in New Issue
Block a user