bsoc-bitbyte / bsoc-bitbyte/Splitt
[BUG] Getting CORS error in dev login.
- Dominant language
- JavaScript
- Stars
- 14
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
### Browser
Chrome
### Area
Auth (login / Google sign-in)
### Steps to reproduce
Start the server on any frontend port other than 5173.
### Expected behavior
The application should work on any frontend port.
### What actually happened
While setting up the project, I was facing CORS error in dev login.
This happened because vite picked up some other port than 5173, which is hardcoded in the backend for course.
This can be solved by setting up a backend proxy in vite.config.js:
```js
export default defineConfig({
plugins: [react()],},
server: {
port: 5173,
proxy: {
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
});
```
### Logs / Screenshots
Contributor guide
Assessment
This issue has not been assessed yet.