Перенес файлы в общую папку

This commit is contained in:
Данил 2024-08-14 17:14:38 +03:00
parent b9a45b69b4
commit 7c835e145a
14 changed files with 7 additions and 9 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "config", "name": "config",
"version": "1.0.0", "version": "1.0.0",
"main": "main.js", "main": "src/main.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },

View file

@ -2,9 +2,7 @@ const fs = require('fs');
const yaml = require('yaml'); const yaml = require('yaml');
const config = () => { const config = () => {
try { if (!fs.existsSync('../config.yaml')) return;
fs.readFileSync('../config.yaml', 'utf-8');
} catch { return }
return yaml.parse(fs.readFileSync('../config.yaml', 'utf-8')); return yaml.parse(fs.readFileSync('../config.yaml', 'utf-8'));
} }

View file

@ -1,7 +1,7 @@
{ {
"name": "database", "name": "database",
"version": "1.0.0", "version": "1.0.0",
"main": "postgresql.js", "main": "src/postgresql.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },

View file

@ -1,5 +1,5 @@
const pool = require('./postgresql.js'); const pool = require('./postgresql.js');
const logger = require('../logger/main.js'); const logger = require('../../logger/src/main.js');
/** /**
* Getting the currency exchange rate for a specific day * Getting the currency exchange rate for a specific day

View file

@ -1,5 +1,5 @@
const pg = require("pg"); const pg = require("pg");
const config = require("../config/main.js")(); const config = require("../../config/src/main.js")();
const pool = new pg.Pool({ const pool = new pg.Pool({
user: config['database']['user'], user: config['database']['user'],

View file

@ -1,7 +1,7 @@
{ {
"name": "logger", "name": "logger",
"version": "1.0.0", "version": "1.0.0",
"main": "main.js", "main": "src/main.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },

View file

@ -1,7 +1,7 @@
const pino = require('pino'); const pino = require('pino');
const pretty = require('pino-pretty'); const pretty = require('pino-pretty');
const path = require('path'); const path = require('path');
const config = require('../config/main.js')(); const config = require('../../config/src/main.js')();
function getCallerFile() { function getCallerFile() {
const originalFunc = Error.prepareStackTrace; const originalFunc = Error.prepareStackTrace;