type ResponsePayload,
type UIServerConfiguration
} from '../../types/index.js'
+import { logger } from '../../utils/index.js'
+
+const moduleName = 'AbstractUIServer'
export abstract class AbstractUIServer {
public readonly chargingStations: Map<string, ChargingStationData>
}
protected startHttpServer (): void {
+ this.httpServer.on('error', error => {
+ logger.error(
+ `${this.logPrefix(moduleName, 'start.httpServer.on.error')} HTTP server error:`,
+ error
+ )
+ })
if (!this.httpServer.listening) {
this.httpServer.listen(this.uiServerConfiguration.options)
}
private stopHttpServer (): void {
if (this.httpServer.listening) {
this.httpServer.close()
+ this.httpServer.removeAllListeners()
}
}