Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pathPrefix for shared webservers (fix #56) #57

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading