Fix urls in code examples

This commit is contained in:
hunicus 2022-01-12 00:43:41 -05:00
parent 5d06d02d64
commit a16decfb94
No known key found for this signature in database
GPG Key ID: 24837C51B6D81FD9
2 changed files with 12 additions and 4 deletions

View File

@ -672,7 +672,7 @@
<a class="section-header" [routerLink]="['./']" fragment="post-transaction">POST Transaction <span>Transactions</span></a>
<div class="endpoint">
<div class="subtitle" i18n="Api docs endpoint">Endpoint</div>
<div>POST /api/tx</div>
<div>POST {{ baseNetworkUrl }}/api/tx</div>
</div>
<div class="description">
<div class="subtitle" i18n>Description</div>

View File

@ -303,10 +303,18 @@ yarn add @mempool/liquid.js`;
return `curl -X POST -sSLd "${text}"`;
}
return `curl -sSL "${this.hostname}/${this.network}${text}"`;
} else if (this.env.BASE_MODULE === 'liquid') {
if (this.method === 'post') {
if (this.network !== 'liquid') {
text = text.replace('/api', `/${this.network}/api`);
}
return `curl -X POST -sSLd "${text}"`;
}
return ( this.network === 'liquid' ? `curl -sSL "${this.hostname}${text}"` : `curl -sSL "${this.hostname}/${this.network}${text}"` );
} else {
return `curl -sSL "${this.hostname}${text}"`;
}
if (this.env.BASE_MODULE !== 'mempool') {
return `curl -sSL "${this.hostname}${text}"`;
}
}
}