Add support for running under a context path, ie. /bonob, replace BONOB_WEB_ADDRESS with BONOB_URL

This commit is contained in:
simojenki
2021-07-23 18:11:32 +10:00
parent 8ed9bef7d8
commit 1153f8e318
16 changed files with 3700 additions and 3053 deletions

View File

@@ -1,7 +1,7 @@
import { Express } from "express";
import request from "supertest";
function supersoap(server: Express, rootUrl: string) {
function supersoap(server: Express) {
return {
request: (
rurl: string,
@@ -9,7 +9,8 @@ function supersoap(server: Express, rootUrl: string) {
callback: (error: any, res?: any, body?: any) => any,
exheaders?: any
) => {
const withoutHost = rurl.replace(rootUrl, "");
const url = new URL(rurl);
const withoutHost = `${url.pathname}${url.search}`;
const req =
data == null
? request(server).get(withoutHost).send()