Add an environment variable for the legacy rewrite rules that arent needed for local dev

This commit is contained in:
Jackson Harper
2023-11-03 15:23:21 +08:00
parent f8a6fc9e0d
commit 67766eefbb

View File

@ -24,6 +24,33 @@ const moduleExports = {
'proxy.omnivore-image-cache.app',
],
},
rewrites: () =>
(process.env.INCLUDE_LEGACY_REWRITES
? [
{
source: '/api/graphql',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/graphql`,
},
{
source: '/api/auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/auth/:path*`,
},
{
source: '/api/article/save',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/article/save`,
},
{
source: '/api/mobile-auth/:path*',
destination: `https://api-${process.env.NEXT_PUBLIC_APP_ENV}.omnivore.app/api/mobile-auth/:path*`,
},
]
: []) +
[
{
source: '/collect/:match*',
destination: 'https://app.posthog.com/:match*',
},
],
async headers() {
return [
{