Skip to content

Commit de8f799

Browse files
committed
Disable staging mode by default, add a way to enable it
1 parent decc654 commit de8f799

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/java/com/creatubbles/api/CreatubblesAPI.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,14 @@ public class CreatubblesAPI {
4242
.property(ClientProperties.READ_TIMEOUT, 5000);
4343

4444
public static String buildURL(final String endPoint) {
45-
return EndPoints.URL_BASE + endPoint;
45+
String base = staging ? EndPoints.URL_BASE_STAGING : EndPoints.URL_BASE;
46+
return base.concat(endPoint);
47+
}
48+
49+
private static boolean staging = false;
50+
51+
public static void setStagingMode(boolean staging) {
52+
CreatubblesAPI.staging = staging;
4653
}
4754

4855
public static void main(String[] args) throws IOException {

src/main/java/com/creatubbles/api/util/EndPoints.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
public class EndPoints {
44

5-
public final static String URL_BASE = "https://staging.creatubbles.com/api/v1/";
5+
public final static String URL_BASE = "https://www.creatubbles.com/api/v1/";
6+
7+
public static final String URL_BASE_STAGING = "https://staging.creatubbles.com/api/v1/";
68

79
public static final String SIGN_IN = "users/sign_in.json";
810

0 commit comments

Comments
 (0)