I recently implemented a method to rewrite requests to my backend server during development:
https://nextjs.org/docs/api-reference/next.config.js/rewrites
rewrites: async () => [
...nextI18NextRewrites(localeSubpaths),
{ source: '/api/:path*', destination: 'http://localhost:8080/:path*' },
],
I'm curious how this setup will function in production where the URL won't be localhost.
When specifying the destination, should I include the full domain or will separate rewrite rules be needed for dev and production environments?