src holds all controllers, config and api
This commit is contained in:
15
src/database/database.js
Normal file
15
src/database/database.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const configuration = require('src/config/configuration').getInstance();
|
||||
const SqliteDatabase = require('src/database/SqliteDatabase');
|
||||
const database = new SqliteDatabase(configuration.get('database', 'host'));
|
||||
|
||||
/**
|
||||
* This module establishes a connection to the database
|
||||
* specified in the confgiuration file. It tries to setup
|
||||
* the required tables after successfully connecting.
|
||||
* If the tables already exists, it simply proceeds.
|
||||
*/
|
||||
Promise.resolve()
|
||||
.then(() => database.connect())
|
||||
// .then(() => database.setUp());
|
||||
|
||||
module.exports = database;
|
||||
Reference in New Issue
Block a user