Connection config and proxy updates.
This commit is contained in:
		
							parent
							
								
									d690511a08
								
							
						
					
					
						commit
						32fdb32792
					
				@ -2,5 +2,17 @@
 | 
				
			|||||||
  "/api": {
 | 
					  "/api": {
 | 
				
			||||||
    "target": "http://localhost:8999/",
 | 
					    "target": "http://localhost:8999/",
 | 
				
			||||||
    "secure": false
 | 
					    "secure": false
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "/ws": {
 | 
				
			||||||
 | 
					    "target": "http://localhost:8999/",
 | 
				
			||||||
 | 
					    "secure": false,
 | 
				
			||||||
 | 
					    "ws": true
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  "/electrs": {
 | 
				
			||||||
 | 
					    "target": "https://www.blockstream.info/api/",
 | 
				
			||||||
 | 
					    "secure": false,
 | 
				
			||||||
 | 
					    "pathRewrite": {
 | 
				
			||||||
 | 
					      "^/electrs": ""
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -3,7 +3,7 @@ import { HttpClient } from '@angular/common/http';
 | 
				
			|||||||
import { Observable } from 'rxjs';
 | 
					import { Observable } from 'rxjs';
 | 
				
			||||||
import { Block, Transaction, Address, Outspend, Recent } from '../interfaces/electrs.interface';
 | 
					import { Block, Transaction, Address, Outspend, Recent } from '../interfaces/electrs.interface';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const API_BASE_URL = 'https://www.blockstream.info/testnet/api';
 | 
					const API_BASE_URL = document.location.protocol + '//' + document.location.hostname + ':' + document.location.port + '/electrs';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
  providedIn: 'root'
 | 
					  providedIn: 'root'
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ import { StateService } from './state.service';
 | 
				
			|||||||
import { Block, Transaction } from '../interfaces/electrs.interface';
 | 
					import { Block, Transaction } from '../interfaces/electrs.interface';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const WEB_SOCKET_PROTOCOL = (document.location.protocol === 'https:') ? 'wss:' : 'ws:';
 | 
					const WEB_SOCKET_PROTOCOL = (document.location.protocol === 'https:') ? 'wss:' : 'ws:';
 | 
				
			||||||
const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + ':8999';
 | 
					const WEB_SOCKET_URL = WEB_SOCKET_PROTOCOL + '//' + document.location.hostname + ':' + document.location.port + '/ws';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
  providedIn: 'root'
 | 
					  providedIn: 'root'
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user