fiftyone.pipeline.cloudrequestengine 4.5.34 → 4.5.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cloudRequestEngine.js +8 -1
- package/package.json +1 -1
- package/readme.md +20 -0
package/cloudRequestEngine.js
CHANGED
|
@@ -81,7 +81,14 @@ class CloudRequestEngine extends Engine {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// Check if baseURL is set. If not try to set it the environment variable
|
|
84
|
-
// if presents, else set to default value
|
|
84
|
+
// if presents, else set to default value.
|
|
85
|
+
//
|
|
86
|
+
// A host other than cloud.51degrees.com would be used to (a) use an
|
|
87
|
+
// on premise web server, or (b) use a privately hosted version of the
|
|
88
|
+
// 51Degrees cloud for performance reasons. This is the private hosting
|
|
89
|
+
// option of the 51Degrees cloud service. Both run the same service, so
|
|
90
|
+
// everything built on this engine works unchanged once FOD_CLOUD_API_URL
|
|
91
|
+
// names the other host's API base including the /api/v4/ segment.
|
|
85
92
|
if (!baseURL) {
|
|
86
93
|
baseURL = process.env.FOD_CLOUD_API_URL;
|
|
87
94
|
if (!baseURL) {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -42,3 +42,23 @@ The integration tests read the resource key from the aligned
|
|
|
42
42
|
`_51DEGREES_RESOURCE_KEY` environment variable first, then the legacy
|
|
43
43
|
`RESOURCE_KEY` variable.
|
|
44
44
|
|
|
45
|
+
## Pointing the engine at another host
|
|
46
|
+
|
|
47
|
+
The engine calls `https://cloud.51degrees.com/api/v4/` unless the `baseURL`
|
|
48
|
+
option is given or the `FOD_CLOUD_API_URL` environment variable is set, in
|
|
49
|
+
which case that value is the API base including the `/api/v4/` segment (a
|
|
50
|
+
missing trailing slash is added). Every engine and example built on this
|
|
51
|
+
package, in this repository and in the device detection and geolocation
|
|
52
|
+
packages, inherits that choice, so setting the variable once points all of
|
|
53
|
+
them at the same place.
|
|
54
|
+
|
|
55
|
+
A host other than `cloud.51degrees.com` would be used to (a) use an on
|
|
56
|
+
premise web server, or (b) use a privately hosted version of the 51Degrees
|
|
57
|
+
cloud for performance reasons. This is the private hosting option of the
|
|
58
|
+
51Degrees cloud service. Both run the same service, so an example works
|
|
59
|
+
unchanged.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
FOD_CLOUD_API_URL=https://cloud.example.com/api/v4/ _51DEGREES_RESOURCE_KEY=<resource key> node yourExample.js
|
|
63
|
+
```
|
|
64
|
+
|