Development proxy

A development proxy forwards some requests from the front end's development server to the API. With Vite, server.proxy routes /api to the Node server: the browser sees only a single origin, which avoids configuring CORS in development.

Example

server: { proxy: { '/api': 'http://localhost:3000' } }

Related concepts

The whole glossary