Add more graphql support to Link

This commit is contained in:
Darren Clarke 2023-03-29 14:43:27 +02:00
parent d7f8c87ccb
commit 60f6061d49
14 changed files with 251 additions and 159 deletions

View file

@ -13,19 +13,11 @@ const withAuthInfo =
return res.redirect("/login");
}
try {
const res2 = await fetch(`http://127.0.0.1:8001`);
console.log({ res2 })
} catch (e) {
console.log({ e })
if (req.headers) {
req.headers['X-Forwarded-User'] = session.email.toLowerCase();
req.headers['host'] = 'zammad.example.com';
}
console.log({ zammad: process.env.ZAMMAD_URL })
req.headers['X-Forwarded-User'] = session.email.toLowerCase();
req.headers['host'] = 'zammad.example.com';
console.log({ headers: req.headers })
return handler(req, res);
};
@ -33,7 +25,7 @@ const proxy = createProxyMiddleware({
target: process.env.ZAMMAD_URL,
changeOrigin: true,
xfwd: true,
ws: true,
ws: false,
pathRewrite: { "^/zammad": "" },
});