Skip to content

Commit e22979c

Browse files
committed
Support pathPrefix for shared webservers (fix #56)
1 parent 50c52be commit e22979c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

connection.schema.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,23 @@
4848
"enum": ["Server and Port"]
4949
},
5050
"server": {
51-
"title": "Server Address",
51+
"title": "Webserver address",
5252
"type": "string",
5353
"minLength": 1,
5454
"default": "localhost"
5555
},
5656
"port": {
57-
"title": "WebServer Port",
57+
"title": "Webserver port",
5858
"minimum": 1,
5959
"default": 52773,
6060
"type": "integer"
6161
},
62+
"pathPrefix": {
63+
"title": "Path prefix (for shared webserver)",
64+
"type": "string",
65+
"pattern": "^(|\/.*[^\/])$",
66+
"default": ""
67+
},
6268
"https": {
6369
"title": "Use HTTPS",
6470
"default": false,

src/ls/irisdb.ts

Lines changed: 2 additions & 2 deletions
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)