Skip to content

Commit

Permalink
feat: cf rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
capJavert committed Nov 22, 2024
1 parent d06b355 commit 5c5c77a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/webapp/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,19 @@ const nextConfig: NextConfig = {
CURRENT_VERSION: version,
},
rewrites: async () => {
if (process.env.CF_DEPLOYMENT_URL) {
return {
beforeFiles: [
{
source: '/:path*',
destination: `${process.env.CF_DEPLOYMENT_URL}/:path*`,
},
],
afterFiles: [],
fallback: [],
};
}

const rewrites: Rewrite[] = [
{
source: '/api/sitemaps/:path*',
Expand Down

0 comments on commit 5c5c77a

Please sign in to comment.