Fix OAuth callback route in production builds

Add SPA routing configuration to serve-handler to ensure /oauth/callback
routes are correctly handled in production builds.
This commit is contained in:
Jerome
2025-02-21 14:28:11 +00:00
parent 27880974a2
commit 4201b31a24

View File

@@ -9,7 +9,10 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
const distPath = join(__dirname, "../dist");
const server = http.createServer((request, response) => {
return handler(request, response, { public: distPath });
return handler(request, response, {
public: distPath,
rewrites: [{ source: "/**", destination: "/index.html" }],
});
});
const port = process.env.PORT || 5173;