I am using react vite . these are my vite config file. Locally it's run fine . When i make api call to this route http://localhost:5173/api/scorecard/send-otp . After deployment it make api call to this route https://meaco.scorecard.doneproject.net/api/scorecard/send-otp
meaco.scorecard.doneproject.net this is the url showing in browser. Now i get the 200 status but there is no response. If i directly use api base path i get cors error.
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
define: {
'process.env': process.env,
},
server: {
cors:false,
proxy: {
'/api': {
secure:false,
target: 'https://api.ryto.com', // Your backend API URL
changeOrigin: true, // Ensures CORS works correctly
// rewrite: (path) => path.replace(/^/api/, ''), // Strips /api from the request
},
},
},
});
Please help