* All file imports change from commonjs to es-module * Improved plex error responses back from api * Converted viewHistory to es module * Es-module requires file extension, updated all imports * Fix esmodule not having __dirname defined in scope * Replace dynamic-require with fs readFileSync * Short message service module function is exported as default * Resolved lint issues & ignore import/extension rule until typescript * All tests file imports changed from commonjs to es-module * Import json fixtures with new helper
16 lines
538 B
JavaScript
16 lines
538 B
JavaScript
import SqliteDatabase from "./sqliteDatabase.js";
|
|
import Configuration from "../config/configuration.js";
|
|
|
|
const configuration = Configuration.getInstance();
|
|
|
|
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.setUp());
|
|
|
|
export default database;
|