diff --git a/src/config.ts b/src/config.ts index 285d6ea..e01988b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -5,6 +5,7 @@ const config = { methods: ['GET', 'POST'] }, mysql: { + enable: false, host: 'localhost', port: 3306, database: '', diff --git a/src/lib/Database/MySQLConnection.ts b/src/lib/Database/MySQLConnection.ts index b72b181..f4fd8e7 100644 --- a/src/lib/Database/MySQLConnection.ts +++ b/src/lib/Database/MySQLConnection.ts @@ -12,6 +12,10 @@ class MySQLConnectPool { private logger = new Logger('MySQLConnection'); constructor() { + if(!config.mysql.enable){ + this.logger.warn('Database is disabled, initialization terminated'); + return; + } this.pool = this.createConnectPool(); this.logger.info("Database connection pool created") setTimeout(async () => {