Minor refactoring work

This commit is contained in:
David Majdandžić
2023-03-30 18:11:12 +02:00
parent 2374cba341
commit 10cf382d00
12 changed files with 139 additions and 405 deletions

View File

@@ -10,8 +10,8 @@ const bodyParser = require("body-parser");
const SERVER_PORT: number = Number(process.env.SERVER_PORT) || 8190;
export class HttpServer {
private clientRequestHandler: RequestHandler;
private centerRequestHandler: RequestHandler;
private readonly clientRequestHandler: RequestHandler;
private readonly centerRequestHandler: RequestHandler;
private app: any;
private server: any;
@@ -24,8 +24,8 @@ export class HttpServer {
this.app = express();
this.app.use(bodyParser.json());
let clientApiPath = 'ClientEntity';
let centerApiPath = 'CenterEntity';
let clientApiPath: string = 'ClientEntity';
let centerApiPath: string = 'CenterEntity';
this.app.get(`/api/${clientApiPath}`, this.clientRequestHandler.doGet.bind(this.clientRequestHandler));
this.app.post(`/api/${clientApiPath}`, this.clientRequestHandler.doPost.bind(this.clientRequestHandler));