Skip to content

Commit

Permalink
Merge pull request #57 from gjsjohnmurray/fix-56
Browse files Browse the repository at this point in the history
Support `pathPrefix` for shared webservers (fix #56)
  • Loading branch information
gjsjohnmurray authored Aug 30, 2024
2 parents a30ebd7 + 653ccee commit 7dbc9f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
10 changes: 8 additions & 2 deletions connection.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@
"enum": ["Server and Port"]
},
"server": {
"title": "Server Address",
"title": "Webserver address",
"type": "string",
"minLength": 1,
"default": "localhost"
},
"port": {
"title": "WebServer Port",
"title": "Webserver port",
"minimum": 1,
"default": 52773,
"type": "integer"
},
"pathPrefix": {
"title": "Path prefix (for shared webserver)",
"type": "string",
"pattern": "^(|\/.*[^\/])$",
"default": ""
},
"https": {
"title": "Use HTTPS",
"default": false,
Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@types/request-promise": "^4.1.47",
"request": "^2.88.2",
"request-promise": "^4.2.6",
"uuid": "^7.0.2"
"uuid": "^8.3.2"
},
"devDependencies": {
"@babel/preset-env": "^7.14.2",
Expand Down
4 changes: 2 additions & 2 deletions src/ls/irisdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class IRISdb {
params?: any,
headers?: any
): Promise<any> {
const { https, host, port, username, password } = this.config;
const { https, host, port, pathPrefix, username, password } = this.config;
if (minVersion > this.apiVersion) {
return Promise.reject(`${path} not supported by API version ${this.apiVersion}`);
}
Expand Down Expand Up @@ -95,7 +95,7 @@ export default class IRISdb {
maxSockets: 10,
rejectUnauthorized: https,
});
path = encodeURI(`/api/atelier/${path || ""}${buildParams()}`);
path = encodeURI(`${pathPrefix || ""}/api/atelier/${path || ""}${buildParams()}`);

const cookies = this.cookies;
let auth;
Expand Down

0 comments on commit 7dbc9f1

Please sign in to comment.