fix: only send UI server response when needed
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIServerFactory.ts
index e7b341d1b0e62260b8156f239171da5d890b10b9..a5fb5a5d627c926e9d700c9ec34bbb273acd476d 100644 (file)
@@ -1,14 +1,13 @@
 import chalk from 'chalk';
 
-import type { UIServerConfiguration } from '../../types/ConfigurationData';
-import { ApplicationProtocol } from '../../types/UIProtocol';
-import Configuration from '../../utils/Configuration';
 import type { AbstractUIServer } from './AbstractUIServer';
-import { UIServiceUtils } from './ui-services/UIServiceUtils';
-import UIHttpServer from './UIHttpServer';
-import UIWebSocketServer from './UIWebSocketServer';
+import { UIHttpServer } from './UIHttpServer';
+import { UIServerUtils } from './UIServerUtils';
+import { UIWebSocketServer } from './UIWebSocketServer';
+import { ApplicationProtocol, type UIServerConfiguration } from '../../types';
+import { Configuration } from '../../utils';
 
-export default class UIServerFactory {
+export class UIServerFactory {
   private constructor() {
     // This is intentional
   }
@@ -16,7 +15,7 @@ export default class UIServerFactory {
   public static getUIServerImplementation(
     uiServerConfiguration?: UIServerConfiguration
   ): AbstractUIServer | null {
-    if (UIServiceUtils.isLoopback(uiServerConfiguration.options?.host) === false) {
+    if (UIServerUtils.isLoopback(uiServerConfiguration.options?.host) === false) {
       console.warn(
         chalk.yellow(
           'Loopback address not detected in UI server configuration. This is not recommended.'