Rewrite Zammad API calls in config rather than middleware
This commit is contained in:
parent
f0e8e20c24
commit
781f8c380a
3 changed files with 17 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ const nextConfig = {
|
|||
"@link-stack/ui",
|
||||
"@link-stack/bridge-common",
|
||||
"@link-stack/bridge-ui",
|
||||
"mui-chips-input"
|
||||
"mui-chips-input",
|
||||
],
|
||||
publicRuntimeConfig: {
|
||||
linkURL: process.env.LINK_URL ?? "http://localhost:3000",
|
||||
|
|
@ -14,6 +14,20 @@ const nextConfig = {
|
|||
labelStudioURL: process.env.LABEL_STUDIO_URL ?? "http://localhost:8006",
|
||||
muiLicenseKey: process.env.MUI_LICENSE_KEY ?? "",
|
||||
},
|
||||
rewrites: async () => {
|
||||
return {
|
||||
beforeFiles: [
|
||||
{
|
||||
source: "/api/v1/:path*",
|
||||
destination: `${process.env.ZAMMAD_URL}/api/v1/:path*`,
|
||||
},
|
||||
{
|
||||
source: "/ws",
|
||||
destination: `${process.env.ZAMMAD_URL}/ws`,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue