25 days ago
My Node.js backend (scenefinder-backend, deployment 9eee43ba) registers POST /api/search and POST /api/upload — confirmed in startup logs. But all POST requests from external clients return {"error":"Route not found"}, which is our app's 404 catch-all handler. This means Railway's ingress proxy is routing POST requests differently than GET requests.
GET /api/library works fine (returns 200). But GET /api/search (a POST-only route) returns 404 instead of 405 Method Not Allowed. This proves the request is being intercepted before Express can check the HTTP method.
Please check if there is a routing rule, ingress config, WAF rule, or proxy layer that is blocking or stripping POST method traffic before it reaches port 8080.
2 Replies
Status changed to Open Railway • 25 days ago
Status changed to Awaiting User Response Railway • 25 days ago
25 days ago
Since you're getting {"error":"Route not found"} , it means your express app is receiving the request, and returning your custom JSON payload. Plus, Express does not return 405s by default. When you send a GET request to a POST route, it just skips your POST route and moves to the next defined routes in your app (in this case, hitting your catch-all segment).
As for POST requests turning into GET requests, one possible scenario this could happen is if your client is using http instead of https, resulting in a redirect to https.
This is from the MDN docs:
Attachments
Status changed to Awaiting Railway Response Railway • 25 days ago
Status changed to Awaiting User Response Railway • 25 days ago
25 days ago
Sharing your express setup would be helpful in determining the real cause, if the previous reply didn't help.
Status changed to Awaiting Railway Response Railway • 25 days ago
Status changed to Awaiting User Response Railway • 25 days ago
18 days ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • 18 days ago