port of home-community base on <...PORT> + <api-version> (V1_0 = 5010,

V2_0 = 5020)
This commit is contained in:
Claus-Peter Hübner 2023-02-10 21:34:40 +01:00
parent fd082f7d0e
commit 73a4450ee2

View File

@ -189,11 +189,9 @@ export const startDHT = async (topic: string): Promise<void> => {
}
async function writeHomeCommunityEnries(pubKey: any): Promise<CommunityApi[]> {
const homeApiVersions: CommunityApi[] = Object.values(ApiVersionType).map(function (
apiEnum,
idx,
) {
const port = Number.parseInt(CONFIG.FEDERATION_COMMUNITY_API_PORT) + idx + 1
const homeApiVersions: CommunityApi[] = Object.values(ApiVersionType).map(function (apiEnum) {
const port =
Number.parseInt(CONFIG.FEDERATION_COMMUNITY_API_PORT) + Number(apiEnum.replace('_', ''))
const comApi: CommunityApi = {
api: apiEnum,
url: CONFIG.FEDERATION_COMMUNITY_URL + ':' + port.toString() + '/api/',