Skip to content

Vercel 404 on redirection#4

Merged
devhiteshk merged 3 commits into
HivarSoft:mainfrom
devhiteshk:main
Jul 19, 2026
Merged

Vercel 404 on redirection#4
devhiteshk merged 3 commits into
HivarSoft:mainfrom
devhiteshk:main

Conversation

@devhiteshk

Copy link
Copy Markdown
Contributor

fix 404 error on oauth app

devhiteshk and others added 3 commits July 19, 2026 12:13
Without this, any direct navigation to a deep route (e.g. /activity,
/authors, /app/settings) returns a 404 because Vercel serves the static
dist/ output and has no file at those paths.

The rewrite rule sends all non-API paths to index.html so React Router
can handle routing on the client side.
src/api/client.ts
- API base is now VITE_API_URL + '/api' when the env var is set,
  falling back to '/api' (Vite dev proxy) when it is not.
  This means local dev is unchanged; Vercel builds point straight
  at the Railway backend.

server/index.ts
- Add gitstats.hivarsoft.com and *.vercel.app to the CORS allowlist
  so the deployed frontend can reach the Railway API.

vercel.json
- Remove the broken /api rewrite that pointed back at Vercel itself.
- Keep only the SPA catch-all so React Router handles all deep links.

.env.example
- Document VITE_API_URL for anyone setting up the project.
@devhiteshk
devhiteshk merged commit f8d0e50 into HivarSoft:main Jul 19, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant