somratpro commited on
Commit
608e075
·
1 Parent(s): 6e26197

feat: redirect /invite paths to /app/invite to support SPA routing structure

Browse files
Files changed (1) hide show
  1. health-server.js +9 -0
health-server.js CHANGED
@@ -862,6 +862,15 @@ const server = http.createServer((req, res) => {
862
  return;
863
  }
864
 
 
 
 
 
 
 
 
 
 
865
  // ── /app/* → strip prefix, proxy to Paperclip ─────────────────────────────
866
  // SPA built with basename="/app"; React Router strips /app client-side.
867
  if (pathname === "/app" || pathname.startsWith("/app/")) {
 
862
  return;
863
  }
864
 
865
+ // ── /invite/* → redirect to /app/invite/* (SPA uses basename="/app") ────────
866
+ if (pathname.startsWith("/invite/") || pathname === "/invite") {
867
+ const rest = pathname.slice("/invite".length) || "/";
868
+ const query = parsedUrl.search || "";
869
+ res.writeHead(302, { Location: "/app/invite" + rest + query });
870
+ res.end();
871
+ return;
872
+ }
873
+
874
  // ── /app/* → strip prefix, proxy to Paperclip ─────────────────────────────
875
  // SPA built with basename="/app"; React Router strips /app client-side.
876
  if (pathname === "/app" || pathname.startsWith("/app/")) {