mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Changed hostname to apiBaseUrl.
This commit is contained in:
parent
3e544f9e7c
commit
f8c311688d
4 changed files with 11 additions and 11 deletions
|
@ -2,7 +2,7 @@
|
|||
"port": 80,
|
||||
"rootGitDirectory": "/var/wlgb/git",
|
||||
"apiKey": "",
|
||||
"hostname": "https://radiant-wind-3058.herokuapp.com/",
|
||||
"apiBaseUrl": "https://radiant-wind-3058.herokuapp.com/api/v0",
|
||||
"username": "staging",
|
||||
"password": "6kUfbv0R",
|
||||
"serviceName": "WriteLatex"
|
||||
|
|
|
@ -20,7 +20,7 @@ public class Config implements JSONSource {
|
|||
private String apiKey;
|
||||
private String username;
|
||||
private String password;
|
||||
private String hostname;
|
||||
private String apiBaseURL;
|
||||
private String serviceName;
|
||||
|
||||
public Config(String configFilePath) throws InvalidConfigFileException, IOException {
|
||||
|
@ -39,11 +39,11 @@ public class Config implements JSONSource {
|
|||
apiKey = getElement(configObject, "apiKey").getAsString();
|
||||
username = getOptionalString(configObject, "username");
|
||||
password = getOptionalString(configObject, "password");
|
||||
String hostname = getElement(configObject, "hostname").getAsString();
|
||||
if (!hostname.endsWith("/")) {
|
||||
hostname += "/";
|
||||
String apiBaseURL = getElement(configObject, "apiBaseUrl").getAsString();
|
||||
if (!apiBaseURL.endsWith("/")) {
|
||||
apiBaseURL += "/";
|
||||
}
|
||||
this.hostname = hostname;
|
||||
this.apiBaseURL = apiBaseURL;
|
||||
serviceName = getElement(configObject, "serviceName").getAsString();
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,8 @@ public class Config implements JSONSource {
|
|||
return password;
|
||||
}
|
||||
|
||||
public String getHostname() {
|
||||
return hostname;
|
||||
public String getAPIBaseURL() {
|
||||
return apiBaseURL;
|
||||
}
|
||||
|
||||
private JsonElement getElement(JsonObject configObject, String name) {
|
||||
|
|
|
@ -52,7 +52,7 @@ public class WLGitBridgeServer {
|
|||
public WLGitBridgeServer(Config config) throws ServletException, InvalidRootDirectoryPathException {
|
||||
this(config.getPort(), config.getRootGitDirectory(), config.getAPIKey());
|
||||
SnapshotAPIRequest.setBasicAuth(config.getUsername(), config.getPassword());
|
||||
writeLatexHostname = config.getHostname();
|
||||
writeLatexHostname = config.getAPIBaseURL();
|
||||
SnapshotAPIRequest.setBaseURL(writeLatexHostname);
|
||||
Util.setServiceName(config.getServiceName());
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
|||
private static String USERNAME;
|
||||
private static String PASSWORD;
|
||||
|
||||
/* Must end with / */
|
||||
private static String BASE_URL;
|
||||
|
||||
public SnapshotAPIRequest(String projectName, String apiCall) {
|
||||
|
@ -31,8 +30,9 @@ public abstract class SnapshotAPIRequest<T extends Result> extends Request<T> {
|
|||
PASSWORD = password;
|
||||
}
|
||||
|
||||
/* baseURL ends with / */
|
||||
public static void setBaseURL(String baseURL) {
|
||||
BASE_URL = baseURL;
|
||||
BASE_URL = baseURL + "/docs/";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue