Add API url override
This commit is contained in:
@@ -41,6 +41,14 @@ public class NightBloom4J {
|
|||||||
return new NightBloom4J(httpClient);
|
return new NightBloom4J(httpClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the API url used by the HTTP client
|
||||||
|
* @param url The new URL to use
|
||||||
|
*/
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.getClient().setBaseUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* API Endpoints for interacting with Projects
|
* API Endpoints for interacting with Projects
|
||||||
* @return A {@link ProjectsEndpoint} endpoint client for executing project requests
|
* @return A {@link ProjectsEndpoint} endpoint client for executing project requests
|
||||||
|
@@ -17,7 +17,7 @@ import java.io.IOException;
|
|||||||
public abstract class HttpClient {
|
public abstract class HttpClient {
|
||||||
|
|
||||||
// Private variables, mostly for internal use
|
// Private variables, mostly for internal use
|
||||||
private final String API_BASE = "http://127.0.0.1:8787";
|
private String API_BASE = "https://api.nightbloom.cc";
|
||||||
|
|
||||||
private final String baseUrl;
|
private final String baseUrl;
|
||||||
private final UserAgent agent;
|
private final UserAgent agent;
|
||||||
@@ -140,4 +140,12 @@ public abstract class HttpClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override the API url for the platform
|
||||||
|
* @param url The new API url to use
|
||||||
|
*/
|
||||||
|
public void setBaseUrl(String url) {
|
||||||
|
this.API_BASE = url;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user