mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 13:24:24 +00:00
fix some things with event loading
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
const posth = require( './api/postHandler.js' );
|
||||
const geth = require( './api/getHandler.js' );
|
||||
const postHandler = new posth();
|
||||
const getHandler = new geth();
|
||||
const path = require( 'path' );
|
||||
const bodyParser = require( 'body-parser' );
|
||||
const mlt = require( 'multer' );
|
||||
const multer = mlt();
|
||||
const fs = require( 'fs' );
|
||||
const getHandler = new geth( JSON.parse( fs.readFileSync( path.join( __dirname + '/../config/settings.config.json' ) ) ) );
|
||||
|
||||
|
||||
// settings is missing in arguments which shouldn't pose any problem
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
const db = require( '../../backend/db/db.js' );
|
||||
|
||||
class GETHandler {
|
||||
constructor () {
|
||||
|
||||
constructor ( settings ) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
handleCall ( call, query ) {
|
||||
@@ -72,6 +72,8 @@ class GETHandler {
|
||||
} ).catch( error => {
|
||||
reject( { 'code': 500, 'error': error } );
|
||||
} );
|
||||
} else if ( call === 'getCurrency' ) {
|
||||
resolve( this.settings.currency );
|
||||
} else {
|
||||
reject( { 'code': 404, 'error': 'Route not found' } );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user