From 376312aae690c5d8f0cf8387cdf03f84fabfcd32 Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Thu, 9 Nov 2023 13:35:11 +0100 Subject: [PATCH] Example using two interfaces --- example/src/index.ts | 5 ++++- lib/src/parser/AIMCParser.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/example/src/index.ts b/example/src/index.ts index 0547cf6..367e7f4 100644 --- a/example/src/index.ts +++ b/example/src/index.ts @@ -28,7 +28,10 @@ const broker = MultiMessageBroker.getInstance(); broker.registerInterfaceConnection({ interfaceConnection: MQTTConnector, config: { reconnectPeriod: 1000 }}) // Also we need to register the aas and the server interfaces it should use. // Multiple server interfaces can be used for the same AAS (by making "serverInterfaces" an array). -broker.registerAAS({ aas, serverInterfaces: { serverInterface: HTTPInterfaceServer, config: { bindPort: 3000, bindAddress: "0.0.0.0" } } }); +broker.registerAAS({ aas, serverInterfaces: [ + { serverInterface: HTTPInterfaceServer, config: { bindPort: 3000, bindAddress: "0.0.0.0" } }, + { serverInterface: HTTPInterfaceServer, config: { bindPort: 3001, bindAddress: "0.0.0.0" } }, +]}); // Prepare the broker (this will create instances of the interfaces and connectors) broker.prepare(); diff --git a/lib/src/parser/AIMCParser.ts b/lib/src/parser/AIMCParser.ts index 76e7c2a..7749ae2 100644 --- a/lib/src/parser/AIMCParser.ts +++ b/lib/src/parser/AIMCParser.ts @@ -1,6 +1,6 @@ import * as aasCore from "@aas-core-works/aas-core3.0-typescript"; import Traverser from "../helper/traverser"; -import { AssetInterfacesMappingConfiguration, MappingConfEntry, MappingConfiguration } from "../types/aimcConf"; +import type { AssetInterfacesMappingConfiguration, MappingConfEntry, MappingConfiguration } from "../types/aimcConf"; import { endpointAvailable, ResolvedRelationshipElement } from "../types/common"; /**