Skip to content

Commit 775eb3d

Browse files
api.rf.com as default example server (#26)
Co-authored-by: GitHub Action <action@github.com>
1 parent 2b2f5e5 commit 775eb3d

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

.github/workflows/run-smoke-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
java-package: jdk
2020
- run: ./gradlew clean :example:run
2121
env:
22-
API_BASE_PATH: "https://testapi.regulaforensics.com"
22+
API_BASE_PATH: "https://test-api.regulaforensics.com"
2323
TEST_LICENSE: ${{secrets.TEST_LICENSE}}

client/src/main/generated/com/regula/documentreader/webclient/ApiClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
public class ApiClient {
5050

51-
private String basePath = "http://localhost:8080";
51+
private String basePath = "https://api.regulaforensics.com";
5252
private boolean debugging = false;
5353
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
5454
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
@@ -132,7 +132,7 @@ public String getBasePath() {
132132
/**
133133
* Set base path
134134
*
135-
* @param basePath Base path of the URL (e.g http://localhost:8080
135+
* @param basePath Base path of the URL (e.g https://api.regulaforensics.com
136136
* @return An instance of OkHttpClient
137137
*/
138138
public ApiClient setBasePath(String basePath) {

example/README.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,50 @@
22

33
:bulb: Before you start: if you just want to play with an online demo, visit our [playground](https://api.regulaforensics.com).
44

5+
:warning: NOTE: If a custom Document Reader endpoint is not specified, demo web API will be used by default.
6+
By sending requests to demo Regula Document Reader web API,
7+
you agree with our [Privacy Policy](https://api.regulaforensics.com/terms)
8+
and [License Agreement](https://downloads.regulaforensics.com/work/SDK/doc/Eula.pdf).
9+
10+
511
Requirements:
612
- installed java 11+
713

8-
Verify Java version:
14+
Java version verification:
915
```bash
1016
java --version
1117
> openjdk 14.0.1 2020-04-14
1218
```
1319

14-
Cloning example:
20+
Example of cloning:
1521
```bash
1622
git clone https://github.com/regulaforensics/DocumentReader-web-java-client.git
1723
cd DocumentReader-web-java-client
1824
```
1925

20-
### Running with local Regula Document Reader web API installation
26+
### Running the client with demo Regula Document Reader web API
27+
:warning: NOTE: for some systems, the `gradlew.bat` command should be used instead of `./gradlew`.
2128

22-
:warning: NOTE: for some systems `gradlew.bat` command should be used, instead of `./gradlew`.
23-
24-
Follow [the instructions](https://docs.regulaforensics.com/web/quick-start-guide) to run Regula Document Reader web API.
25-
Assuming you have successfully launched instance, use next line command to run example:
29+
Example of execution:
2630
```bash
2731
./gradlew :example:run
28-
29-
# If Regula Document Reader web API is running not on localhost, specify host via env variable:
30-
API_BASE_PATH="http://192.168.0.101:8080" ./gradlew :example:run
3132
```
3233

33-
### Running using Regula Document Reader web API test SaaS
34+
### Running the client with local Regula Document Reader web API installation
35+
:warning: NOTE: for some systems, the `gradlew.bat` command should be used instead of `./gradlew`.
3436

35-
:warning: NOTE: for some systems `gradlew.bat` command should be used, instead of `./gradlew`.
37+
Get your [free trial here](https://mobile.regulaforensics.com/). When you receive the `regula.license` file,
38+
copy it to the [example resources](../example/src/main/resources) folder. Now you are ready for start!
3639

37-
Get your [free trial here](https://mobile.regulaforensics.com/). You should obtain `regula.license` file.
38-
Copy it to [example resources](../example/src/main/resources) folder. You are ready for running!
40+
Follow [the instructions](https://docs.regulaforensics.com/web-service/quick-start-guide) to run Regula Document Reader web API.
41+
If the instance has been launched successfully, use the following line command to run the example:
3942

40-
Execute example:
4143
```bash
42-
API_BASE_PATH="https://test-api.regulaforensics.com" ./gradlew :example:run
44+
API_BASE_PATH="http://127.0.0.1:8080" ./gradlew :example:run
4345
```
4446

4547
### Output
46-
This sample generates next text output:
48+
This sample generates the following text output:
4749
```text
4850
---------------------------------------------------------------------------
4951
Document Overall Status: not valid
@@ -54,5 +56,6 @@ This sample generates next text output:
5456
MRZ-Visual values comparison: 1
5557
---------------------------------------------------------------------------
5658
```
57-
Also, it creates [portrait](portrait.jpg) and [document image](document-image.jpg) pictures inside current folder.
58-
Edit [example](../example/src/main/java/com/regula/documentreader/webclient/example/Main.java) on your own , and re-run to see your results.
59+
Also, it stores [portrait](portrait.jpg) and [document image](document-image.jpg) images in the current folder.
60+
You can modify [this example](../example/src/main/java/com/regula/documentreader/webclient/example/Main.java)
61+
and re-run it to get your own results.

example/src/main/java/com/regula/documentreader/webclient/example/Main.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void main(String[] args) throws IOException, ApiException {
3434

3535
var apiBaseUrl = System.getenv(API_BASE_PATH);
3636
if (apiBaseUrl == null) {
37-
apiBaseUrl = "http://localhost:8080";
37+
apiBaseUrl = "https://api.regulaforensics.com";
3838
}
3939
var licenseFromEnv = System.getenv(TEST_LICENSE); // optional, used here only for smoke test purposes
4040
var licenseFromFile = readFile("regula.license");
@@ -111,6 +111,7 @@ public static void main(String[] args) throws IOException, ApiException {
111111

112112
// how to get low lvl individual results
113113
LexicalAnalysisResult lexResult = response.resultByType(Result.LEXICAL_ANALYSIS);
114+
System.exit(0);
114115
}
115116

116117
@Nullable

0 commit comments

Comments
 (0)