File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,22 +79,6 @@ The API hosts to use can be specified at runtime or at build time. By default
7979the current host is used for the Routinator API endpoints and https://rest.bgp-api.net
8080for the Roto API.
8181
82- ### Runtime
83-
84- The ` index.html ` file contains the following fragment:
85-
86- ``` javascript
87- window .ROTO_API_HOST = ' ROTO_API_HOST_PLACEHOLDER' ;
88- window .ROUTINATOR_API_HOST = ' ROUTINATOR_API_HOST_PLACEHOLDER' ;
89- ```
90-
91- The respective endpoints can be configured by replacing the string
92- ` ROTO_API_HOST_PLACEHOLDER ` and/or the string ` ROUTINATOR_API_HOST_PLACEHOLDER `
93- before serving the content of ` index.html ` . If these are not configured at runtime
94- the build time variables or the defaults will be used.
95-
96- ### Build time
97-
9882By specifying ` ROTO_API_HOST ` and/or ` ROUTINATOR_API_HOST ` as environment variables
9983these can be configured at build time. For example:
10084
Original file line number Diff line number Diff line change 66 < meta name ="description " content ="User interface for Routinator. Perform a Prefix Check, view detailed statistics from the last validation run Routinator has performed and HTTP and RTR connection metrics. " />
77 < title > Routinator</ title >
88 < link rel ="icon " href ="/src/img/favicon.ico ">
9- < script >
10- window . ROTO_API_HOST = 'ROTO_API_HOST_PLACEHOLDER' ;
11- window . ROUTINATOR_API_HOST = 'ROUTINATOR_API_HOST_PLACEHOLDER' ;
12- </ script >
139 </ head >
1410 < body >
1511 < div id ="root "> </ div >
Original file line number Diff line number Diff line change 1- function getRotoEndpoint ( ) {
2- if (
3- typeof window !== 'undefined' &&
4- window . ROTO_API_HOST !== 'ROTO_API_HOST_PLACEHOLDER'
5- ) {
6- return window . ROTO_API_HOST ;
7- }
8-
9- if ( typeof ROTO_API_HOST !== 'undefined' ) {
10- return ROTO_API_HOST ;
11- }
12-
13- return 'https://rest.bgp-api.net' ;
14- }
15-
16- // public endpoint: https://routinator.do.nlnetlabs.nl
17- function getApiEndpoint ( ) {
18- if (
19- typeof window !== 'undefined' &&
20- window . ROUTINATOR_API_HOST !== 'ROUTINATOR_API_HOST_PLACEHOLDER'
21- ) {
22- return window . ROUTINATOR_API_HOST ;
23- }
24-
25- if ( typeof ROUTINATOR_API_HOST !== 'undefined' ) {
26- return ROUTINATOR_API_HOST ;
27- }
28-
29- return '' ;
30- }
31-
32- export const ROTO_ENDPOINT = getRotoEndpoint ( ) ;
33- export const API_ENDPOINT = getApiEndpoint ( ) ;
1+ export const ROTO_ENDPOINT =
2+ typeof ROTO_API_HOST === 'undefined'
3+ ? 'https://rest.bgp-api.net'
4+ : ROTO_API_HOST ;
5+ export const API_ENDPOINT =
6+ typeof ROUTINATOR_API_HOST === 'undefined'
7+ ? 'https://routinator.do.nlnetlabs.nl'
8+ : ROUTINATOR_API_HOST ;
Original file line number Diff line number Diff line change @@ -207,9 +207,3 @@ export interface RouteIdent {
207207 max_length : string ;
208208}
209209
210- declare global {
211- interface Window {
212- ROUTINATOR_API_HOST : string ;
213- ROTO_API_HOST : string ;
214- }
215- }
You can’t perform that action at this time.
0 commit comments