remove port from dht-url

This commit is contained in:
Claus-Peter Hübner 2023-03-02 13:28:12 +01:00
parent 9907a4caf4
commit 9419e9062c
2 changed files with 8 additions and 10 deletions

View File

@ -719,11 +719,11 @@ describe('federation', () => {
JSON.stringify([
{
api: '1_0',
url: 'http://localhost:5001/api/',
url: 'http://localhost/api/',
},
{
api: '2_0',
url: 'http://localhost:5002/api/',
url: 'http://localhost/api/',
},
]),
),
@ -747,7 +747,7 @@ describe('federation', () => {
foreign: true,
publicKey: expect.any(Buffer),
apiVersion: '1_0',
endPoint: 'http://localhost:5001/api/',
endPoint: 'http://localhost/api/',
lastAnnouncedAt: expect.any(Date),
createdAt: expect.any(Date),
updatedAt: null,
@ -764,7 +764,7 @@ describe('federation', () => {
foreign: true,
publicKey: expect.any(Buffer),
apiVersion: '2_0',
endPoint: 'http://localhost:5002/api/',
endPoint: 'http://localhost/api/',
lastAnnouncedAt: expect.any(Date),
createdAt: expect.any(Date),
updatedAt: null,
@ -786,15 +786,15 @@ describe('federation', () => {
JSON.stringify([
{
api: '1_0',
url: 'http://localhost:5001/api/',
url: 'http://localhost/api/',
},
{
api: '1_1',
url: 'http://localhost:5002/api/',
url: 'http://localhost/api/',
},
{
api: '2_0',
url: 'http://localhost:5003/api/',
url: 'http://localhost/api/',
},
]),
),

View File

@ -181,11 +181,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) {
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/',
url: CONFIG.FEDERATION_COMMUNITY_URL + '/api/',
}
return comApi
})