Fix node reverse proxy
This commit is contained in:
@@ -26,8 +26,9 @@ export default class ApplicationsApiService extends TdriveService<undefined> {
|
|||||||
const { proxy, close } = FastProxy({
|
const { proxy, close } = FastProxy({
|
||||||
base: domain,
|
base: domain,
|
||||||
});
|
});
|
||||||
|
console.log("Listening at ", "/" + prefix.replace(/(\/$|^\/)/gm, "") + "/*");
|
||||||
fastify.addHook("onClose", close);
|
fastify.addHook("onClose", close);
|
||||||
fastify.all("/" + prefix.replace(/(\/$|^\/)/, "") + "/*", (req, rep) => {
|
fastify.all("/" + prefix.replace(/(\/$|^\/)/gm, "") + "/*", (req, rep) => {
|
||||||
proxy(req.raw, rep.raw, req.url, {});
|
proxy(req.raw, rep.raw, req.url, {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user