Skip to content

Commit

Permalink
fix: convert config.cjs to config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
frantzarty committed Jun 29, 2022
1 parent c3b0c06 commit 0764755
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 96 deletions.
95 changes: 0 additions & 95 deletions src/config/config.cjs

This file was deleted.

38 changes: 38 additions & 0 deletions src/config/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { getConfig } from '../utils/config-loader';
import { getDataModelVersion } from '../utils/helpers';
import os from 'os';

const homeDir = os.homedir();

const persistanceFolder = `${homeDir}/.chia/climate-warehouse/${getDataModelVersion()}`;

export default {
local: {
dialect: 'sqlite',
storage: `${persistanceFolder}/data.sqlite3`,
logging: false,
},
simulator: {
dialect: 'sqlite',
storage: `${persistanceFolder}/simulator.sqlite3`,
logging: false,
},
test: {
dialect: 'sqlite',
storage: './test.sqlite3',
logging: false,
},
mirrorTest: {
dialect: 'sqlite',
storage: './testMirror.sqlite3',
logging: false,
},
mirror: {
username: getConfig().MIRROR_DB.DB_USERNAME || '',
password: getConfig().MIRROR_DB.DB_PASSWORD || '',
database: getConfig().MIRROR_DB.DB_NAME || '',
host: getConfig().MIRROR_DB.DB_HOST || '',
dialect: 'mysql',
logging: false,
},
};
2 changes: 1 addition & 1 deletion src/database/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Sequelize } from 'sequelize';
import config from '../config/config.cjs';
import config from '../config/config.js';
import { logger } from '../config/logger.cjs';
import mysql from 'mysql2/promise';
import { getConfig } from '../utils/config-loader';
Expand Down

0 comments on commit 0764755

Please sign in to comment.