Apply dependencies update
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / AbstractUIServer.ts
index d8ef6340296b5b2ddefa4dbd471529e197a72f40..cc1f82f5f9b34cdeae081794780a2ee6f5f97312 100644 (file)
@@ -6,12 +6,12 @@ import type { ChargingStationData } from '../../types/ChargingStationWorker';
 import type { UIServerConfiguration } from '../../types/ConfigurationData';
 import {
   AuthenticationType,
-  ProcedureName,
-  ProtocolRequest,
-  ProtocolResponse,
-  ProtocolVersion,
-  RequestPayload,
-  ResponsePayload,
+  type ProcedureName,
+  type ProtocolRequest,
+  type ProtocolResponse,
+  type ProtocolVersion,
+  type RequestPayload,
+  type ResponsePayload,
 } from '../../types/UIProtocol';
 import type AbstractUIService from './ui-services/AbstractUIService';
 import UIServiceFactory from './ui-services/UIServiceFactory';
@@ -45,6 +45,12 @@ export abstract class AbstractUIServer {
     this.chargingStations.clear();
   }
 
+  protected startHttpServer(): void {
+    if (this.httpServer.listening === false) {
+      this.httpServer.listen(this.uiServerConfiguration.options);
+    }
+  }
+
   protected registerProtocolVersionUIService(version: ProtocolVersion): void {
     if (this.uiServices.has(version) === false) {
       this.uiServices.set(version, UIServiceFactory.getUIServiceImplementation(version, this));