The core issue was a mismatch between your deployment and your documentation.
When RevaDates tried to send database queries to https://fluxbase.vercel.app/api, the server kept returning a 405 Method Not Allowed error and crashing.
-
Wrong API Endpoint: The
Fluxbase-Integration-Guide.pdfstated that queries should be sent to/v1/projects/<ID>/query. However, your actualfluxbase.vercel.appbackend was built with Next.js App Router, and the actual route you configured to handle SQL execution was located at/api/execute-sql. -
Wrong Payload Structure: The PDF documented that the body should contain
{ "sql": "query string" }. However, your custom backend was programmed to strictly expect{ "projectId": "...", "query": "..." }.
Because RevaDates was following the PDF instructions, Vercel had no idea what to do with the unexpected routes, so it immediately rejected the connections with a 405 Method Not Allowed.
-
Error Handling: I added
try/catchblocks around all of the Server Actions in RevaDates so it handles server outages gracefully instead of throwing unhandled promise rejections and crashing Node. -
Custom URL Detection: I updated
src/lib/fluxbase/server.tsto automatically detect if you are using the Vercel app. If so, it dynamically overrides the PDF instructions, formats the body to match your{ projectId, query }layout, and targets the undocumented/api/execute-sqlroute. -
Response Parsing: I updated the mapper to parse the nested
data.result.rowsJSON object layout that the custom API returns.