mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-13 00:18:50 +00:00
yaml validation
This commit is contained in:
parent
b5065673ab
commit
17f54da524
11 changed files with 83 additions and 32 deletions
9
src/pages/api/validate.js
Normal file
9
src/pages/api/validate.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
import checkAndCopyConfig from "utils/config";
|
||||
|
||||
const configs = ["docker.yaml", "settings.yaml", "services.yaml", "bookmarks.yaml"];
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const errors = configs.map((config) => checkAndCopyConfig(config)).filter((status) => status !== true);
|
||||
|
||||
res.send(errors);
|
||||
}
|
|
@ -14,7 +14,7 @@ export default async function handler(req, res) {
|
|||
}
|
||||
|
||||
if (!apiKey && provider) {
|
||||
const settings = await getSettings();
|
||||
const settings = getSettings();
|
||||
apiKey = settings?.providers?.openweathermap;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export default async function handler(req, res) {
|
|||
}
|
||||
|
||||
if (!apiKey && provider) {
|
||||
const settings = await getSettings();
|
||||
const settings = getSettings();
|
||||
apiKey = settings?.providers?.weatherapi;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue