saleor-apps-redis_apl/apps/monitoring/next.config.js
Przemysław Łada b33bfd35af
Add Saleor Monitoring app (#189)
* initial commit

* Remove pre-commit-config

* Update gitignore

* Update README

* Add better config for monitoring app (#190)

---------

Co-authored-by: Lukasz Ostrowski <lukasz.ostrowski@saleor.io>
2023-02-22 12:23:04 +01:00

21 lines
569 B
JavaScript

/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
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 ?? "";
return {
fallback: [
{
source: "/:path*",
destination: `${backendPath}/:path*`,
},
],
};
},
};