Merge pull request #800 from mempool/simon/api-docs-hostname-fix
Always use local hostname for API examples.
This commit is contained in:
		
						commit
						50c5244abf
					
				| @ -698,7 +698,7 @@ | |||||||
|               </ng-template> |               </ng-template> | ||||||
|               <ng-template ngbPanelContent> |               <ng-template ngbPanelContent> | ||||||
|                 <div class="endpoint"> |                 <div class="endpoint"> | ||||||
|                   <a [href]="wrapUrl(network.val, code.mempoolRecent)" target="_blank">GET {{ baseNetworkUrl }}/api/tx/:txid</a> |                   <a [href]="wrapUrl(network.val, code.transaction)" target="_blank">GET {{ baseNetworkUrl }}/api/tx/:txid</a> | ||||||
|                 </div> |                 </div> | ||||||
|                 <div class="description"> |                 <div class="description"> | ||||||
|                   <div class="subtitle" i18n>Description</div> |                   <div class="subtitle" i18n>Description</div> | ||||||
|  | |||||||
| @ -40,18 +40,6 @@ export class ApiDocsComponent implements OnInit { | |||||||
| 
 | 
 | ||||||
|     this.hostname = `${document.location.protocol}//${this.hostname}`; |     this.hostname = `${document.location.protocol}//${this.hostname}`; | ||||||
| 
 | 
 | ||||||
|     if (document.location.hostname === 'localhost') { |  | ||||||
|       if (this.env.BASE_MODULE === 'bisq') { |  | ||||||
|         this.hostname = `https://bisq.markets`; |  | ||||||
|       } |  | ||||||
|       if (this.env.BASE_MODULE === 'liquid') { |  | ||||||
|         this.hostname = `https://liquid.network`; |  | ||||||
|       } |  | ||||||
|       if (this.env.BASE_MODULE === 'mempool') { |  | ||||||
|         this.hostname = `https://mempool.space`; |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     this.code = { |     this.code = { | ||||||
|       address: { |       address: { | ||||||
|         codeTemplate: { |         codeTemplate: { | ||||||
| @ -2063,7 +2051,7 @@ export class ApiDocsComponent implements OnInit { | |||||||
|       }, |       }, | ||||||
|       transactionCpfp: { |       transactionCpfp: { | ||||||
|         codeTemplate: { |         codeTemplate: { | ||||||
|           curl: `/api/fees/cpfp/%{1}`, |           curl: `/api/v1/cpfp/%{1}`, | ||||||
|           commonJS: ` |           commonJS: ` | ||||||
|         const { %{0}: { fees } } = mempoolJS(); |         const { %{0}: { fees } } = mempoolJS(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user