Use configured database file.

This commit is contained in:
baldo 2016-05-20 22:38:13 +02:00
parent 03271573be
commit 8102181a7e
3 changed files with 53 additions and 40 deletions
server/db

View file

@ -5,6 +5,8 @@ var fs = require('fs');
var glob = require('glob');
var path = require('path');
var config = require('../config');
function applyPatch(db, file, callback) {
fs.readFile(file, function (err, contents) {
if (err) {
@ -62,7 +64,7 @@ function applyMigrations(db, callback) {
module.exports = {
init: function (callback) {
var SQLite3 = require('sqlite3');
var db = new SQLite3.Database('/tmp/test.sqlite');
var db = new SQLite3.Database(config.server.databaseFile);
applyMigrations(db, function (err) {
if (err) {