Сервис конфига

This commit is contained in:
Данил 2024-07-30 18:05:02 +03:00
parent 08bbb5dd67
commit a2eccb53e9
4 changed files with 64 additions and 0 deletions

13
config/main.js Normal file
View file

@ -0,0 +1,13 @@
const fs = require('fs');
const yaml = require('yaml');
const config = () => {
try {
fs.readFileSync('../config.yaml', 'utf-8');
} catch { return }
return yaml.parse(fs.readFileSync('../config.yaml', 'utf-8'));
}
module.exports = config;