|
@@ -2,10 +2,13 @@ const level = require('level');
|
|
const sub = require('level-sublevel');
|
|
const sub = require('level-sublevel');
|
|
const search = require('level-search');
|
|
const search = require('level-search');
|
|
|
|
|
|
|
|
+var path = require('path');
|
|
|
|
+var DIR = path.dirname(__filename);
|
|
|
|
+console.log(DIR);
|
|
class Database {
|
|
class Database {
|
|
constructor(){
|
|
constructor(){
|
|
console.log("Constructing database!")
|
|
console.log("Constructing database!")
|
|
- this.db = sub(level("./database/mafaldadb", {valueEncoding: 'json'}));
|
|
|
|
|
|
+ this.db = sub(level(DIR + "/mafaldadb", {valueEncoding: 'json'}));
|
|
this.index = search(this.db, 'search');
|
|
this.index = search(this.db, 'search');
|
|
}
|
|
}
|
|
open(callback){
|
|
open(callback){
|