next.js/test/e2e/link-with-api-rewrite/app/next.config.js
next.config.js18 lines358 B
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  async rewrites() {
    return {
      beforeFiles: [
        {
          source: '/:path(.*)',
          has: [{ type: 'query', key: 'json', value: 'true' }],
          destination: '/api/json?from=/:path',
        },
      ],
    }
  },
}

module.exports = nextConfig
Quest for Codev2.0.0
/
SIGN IN