@@ -26,15 +26,15 @@ export class IpregistryConfig {
2626
2727 public readonly apiKey : string ;
2828
29- public readonly apiUrl : string = 'https://api.ipregistry.co' ;
29+ public readonly baseUrl : string = 'https://api.ipregistry.co' ;
3030
3131 public readonly timeout : number = 15000 ;
3232
33- constructor ( apiKey : string , apiUrl : string , timeout : number ) {
33+ constructor ( apiKey : string , baseUrl : string , timeout : number ) {
3434 this . apiKey = apiKey ;
3535
36- if ( apiUrl ) {
37- this . apiUrl = apiUrl ;
36+ if ( baseUrl ) {
37+ this . baseUrl = baseUrl ;
3838 }
3939
4040 if ( timeout ) {
@@ -48,16 +48,24 @@ export class IpregistryConfigBuilder {
4848
4949 private apiKey : string ;
5050
51- private apiUrl : string = 'https://api.ipregistry.co' ;
51+ private baseUrl : string = 'https://api.ipregistry.co' ;
5252
5353 private timeout : number = 15000 ;
5454
5555 constructor ( apiKey : string ) {
5656 this . apiKey = apiKey ;
5757 }
5858
59+ /*
60+ * Use the new {@link IpregistryConfigBuilder.withBaseUrl} method instead.
61+ */
5962 public withApiUrl ( apiUrl : string ) : IpregistryConfigBuilder {
60- this . apiUrl = apiUrl ;
63+ this . baseUrl = apiUrl ;
64+ return this ;
65+ }
66+
67+ public withBaseUrl ( baseUrl : string ) : IpregistryConfigBuilder {
68+ this . baseUrl = baseUrl ;
6169 return this ;
6270 }
6371
@@ -67,7 +75,7 @@ export class IpregistryConfigBuilder {
6775 }
6876
6977 public build ( ) : IpregistryConfig {
70- return new IpregistryConfig ( this . apiKey , this . apiUrl , this . timeout ) ;
78+ return new IpregistryConfig ( this . apiKey , this . baseUrl , this . timeout ) ;
7179 }
7280
7381}
0 commit comments