DEV Community

Sujan Maharjan
Sujan Maharjan

Posted on

Vite Server Proxy

I configured the proxy like this in vite.config.js. I ran npm run dev. It works. The endpoint returns the data. Below is the image of vite.config.js
Image description

Now the problem is when i build this application using npm run build. It creates dist and when i run this dist with npx serve dist. Application runs but when hitting the endpoint it gives error.Below are the screenshots. Even when username and password is sent, the payload is still empty

Image description

Image description

Image description

Top comments (0)