Skip to content

Commit 7dbc9f1

Browse files
Merge pull request #57 from gjsjohnmurray/fix-56
Support `pathPrefix` for shared webservers (fix #56)
2 parents a30ebd7 + 653ccee commit 7dbc9f1

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

connection.schema.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,23 @@
5757
"enum": ["Server and Port"]
5858
},
5959
"server": {
60-
"title": "Server Address",
60+
"title": "Webserver address",
6161
"type": "string",
6262
"minLength": 1,
6363
"default": "localhost"
6464
},
6565
"port": {
66-
"title": "WebServer Port",
66+
"title": "Webserver port",
6767
"minimum": 1,
6868
"default": 52773,
6969
"type": "integer"
7070
},
71+
"pathPrefix": {
72+
"title": "Path prefix (for shared webserver)",
73+
"type": "string",
74+
"pattern": "^(|\/.*[^\/])$",
75+
"default": ""
76+
},
7177
"https": {
7278
"title": "Use HTTPS",
7379
"default": false,

package-lock.json

+5-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@types/request-promise": "^4.1.47",
6464
"request": "^2.88.2",
6565
"request-promise": "^4.2.6",
66-
"uuid": "^7.0.2"
66+
"uuid": "^8.3.2"
6767
},
6868
"devDependencies": {
6969
"@babel/preset-env": "^7.14.2",

src/ls/irisdb.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default class IRISdb {
5656
params?: any,
5757
headers?: any
5858
): Promise<any> {
59-
const { https, host, port, username, password } = this.config;
59+
const { https, host, port, pathPrefix, username, password } = this.config;
6060
if (minVersion > this.apiVersion) {
6161
return Promise.reject(`${path} not supported by API version ${this.apiVersion}`);
6262
}
@@ -95,7 +95,7 @@ export default class IRISdb {
9595
maxSockets: 10,
9696
rejectUnauthorized: https,
9797
});
98-
path = encodeURI(`/api/atelier/${path || ""}${buildParams()}`);
98+
path = encodeURI(`${pathPrefix || ""}/api/atelier/${path || ""}${buildParams()}`);
9999

100100
const cookies = this.cookies;
101101
let auth;

0 commit comments

Comments
 (0)