File tree 4 files changed +8
-59
lines changed
4 files changed +8
-59
lines changed 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
79
79
the current host is used for the Routinator API endpoints and https://rest.bgp-api.net
80
80
for the Roto API.
81
81
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
-
98
82
By specifying ` ROTO_API_HOST ` and/or ` ROUTINATOR_API_HOST ` as environment variables
99
83
these can be configured at build time. For example:
100
84
Original file line number Diff line number Diff line change 6
6
< 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. " />
7
7
< title > Routinator</ title >
8
8
< 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 >
13
9
</ head >
14
10
< body >
15
11
< 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 {
207
207
max_length : string ;
208
208
}
209
209
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