fix some things with event loading

This commit is contained in:
2023-08-11 16:32:53 +02:00
parent d5c581170f
commit dbfe89998e
11 changed files with 120 additions and 67 deletions

View File

@@ -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

View File

@@ -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' } );
}