Update .gitignore and add new dependencies and routes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-04-02 20:59:13 +02:00
parent aa75d50361
commit 8f3e604774
16 changed files with 823 additions and 187 deletions

View File

@@ -1,11 +1,14 @@
const fs = require('fs');
const path = require('path');
const { logger, ErrorLogger, logRequestInfo } = require('../config/logs');
const dataFolderPath = path.join(__dirname, '../data');
const filesToCreate = ['setup.json', 'user.json', 'file_info.json'];
filesToCreate.forEach((fileName) => {
if (!fs.existsSync(fileName)) {
fs.writeFileSync(fileName, '{}');
const filePath = path.join(dataFolderPath, fileName);
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, '[]');
logger.info(`${fileName} created successfully.`);
} else {
logger.info(`${fileName} already exists.`);