src holds all controllers, config and api

This commit is contained in:
Kevin Midboe
2017-04-12 22:20:31 +02:00
parent 35146a5964
commit 6c29e59b2b
14 changed files with 361 additions and 0 deletions

15
src/database/database.js Normal file
View 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;