Update .gitignore and add new dependencies and routes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -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.`);
|
||||
|
||||
Reference in New Issue
Block a user