For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guides/basic-features/debug/proxy.md.

Local Proxy

Modern.js provides a way to configure the development proxy in dev.server.proxy.

For example, to proxy the local interface to another address:

modern.config.ts
import { defineConfig } from '@modern-js/app-tools';

export default defineConfig({
  dev: {
    server: {
      proxy: {
        // http://localhost:8080/api -> https://example.com/api
        // http://localhost:8080/api/foo -> https://example.com/api/foo
        '/api': 'https://example.com',
      },
    },
  },
});