mirror of
https://github.com/wkulhanek/bonob.git
synced 2025-12-21 17:33:29 +01:00
Add support for running under a context path, ie. /bonob, replace BONOB_WEB_ADDRESS with BONOB_URL
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user