-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
548f657
commit 8db584f
Showing
16 changed files
with
260 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { UPublicationsResponse } from '@/app/dto/PeersDTO'; | ||
import { PeerPublicationsResponse } from '@/grpc_generated/route'; | ||
import { GetFlowHttpAddressFromEnv } from '@/rpc/http'; | ||
|
||
export async function POST(request: Request) { | ||
const body = await request.json(); | ||
const { peerName } = body; | ||
const flowServiceAddr = GetFlowHttpAddressFromEnv(); | ||
try { | ||
const publicationList: PeerPublicationsResponse = await fetch( | ||
`${flowServiceAddr}/v1/peers/publications?peer_name=${peerName}` | ||
).then((res) => { | ||
return res.json(); | ||
}); | ||
let response: UPublicationsResponse = { | ||
publicationNames: publicationList.publicationNames, | ||
}; | ||
return new Response(JSON.stringify(response)); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.