createPieceUrlPDP
createPieceUrlPDP(
cid,pdpUrl):string
Defined in: packages/synapse-core/src/utils/piece-url.ts:34
Create a piece URL for the PDP API
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
cid | string | The PieceCID identifier |
pdpUrl | string | The PDP URL |
Returns
Section titled “Returns”string
The PDP URL for the piece
Example
Section titled “Example”const pdpUrl = 'https://pdp.example.com'const cid = 'bafkzcibcd4bdomn3tgwgrh3g532zopskstnbrd2n3sxfqbze7rxt7vqn7veigmy'const pieceUrl = createPieceUrlPDP(cid, pdpUrl)console.log(pieceUrl) // https://pdp.example.com/piece/bafkzcibcd4bdomn3tgwgrh3g532zopskstnbrd2n3sxfqbze7rxt7vqn7veigmy