saleor-apps-redis_apl/apps/monitoring/next.config.js
Lukasz Ostrowski 3bd7e3f05d
Monitoring app UI (#677)
* Replace macaw to next

* UI WIP

* ui wip

* fix graphql calls

* Fix ui

* Changsets

* Apply CR review

* fix spacing
2023-06-27 19:20:58 +02:00

26 lines
759 B
JavaScript

/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
transpilePackages: ["@saleor/apps-shared", "@saleor/apps-ui", "@saleor/react-hook-form-macaw"],
rewrites() {
/**
* For dev/preview Next.js can work as a proxy and redirect unknown paths to provided backend address
*
* In production, when env is not provided, frontend will call its relative path and reverse proxy will do the rest
*/
const backendPath = process.env.MONITORING_APP_API_URL;
if(!backendPath) {
throw new Error('Please set MONITORING_APP_API_URL variable')
}
return {
fallback: [
{
source: "/:path*",
destination: `${backendPath}/:path*`,
},
],
};
},
};