Having issues with hosting the litestar application with a separate frontend.
Running pnpm run dev
with litestar run -r
works just fine.
Problem is getting this to production level infrastructure.
In my repository that I've linked, I place a caddy server infront of it and I end up receiving this error.
Access to fetch at 'http://localhost/accounts/login' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
https://github.com/BrianLYS/sveltekit-litestar-cors-error
Access to fetch at 'http://localhost/accounts/login' from origin 'http://localhost:5173' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
1. Start Caddy, Backend and Postgresql Server with `docker compose up` in root dir
2. Start frontend server, `cd frontend/app`, `cp .env.example .env`, `pnpm install`, `pnpm run dev`
3. Open localhost:5173 in browser
4. Click register, fill in form.
5. Login with credentials.
6. Inspect console to see error log.
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
No response
2.8.3
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too