R
Railway15mo ago
PatuRoco

Cannot use other HTTP verbs than GET

Service ID: 477e340b-e1f6-4da7-8ae2-2eeb32de06ee Hello, i'm having trouble using HTTP verbs other than the GET method when trying to access another endpoint than GET in my front-end or on postman, like the "/autenticar" This error only occurs when I try to execute a method other than GET, such as the "/cidades" endpoint, a GET listing method, but if I call it again passing the POST verb, the response is as if I did in GET, even not having the "POST /cidades"
8 Replies
Percy
Percy15mo ago
Project ID: 477e340b-e1f6-4da7-8ae2-2eeb32de06ee
Brody
Brody15mo ago
you need to be using the https scheme when accessing your railway app
rando
rando15mo ago
^ and make sure you have a POST handler on that route. 404 usually means you're not handling POST requests for the route (the technically correct status code is 405, but frameworks are weird)
PatuRoco
PatuRoco15mo ago
But the point is... i already deployed this API... but when i make it the first time, this exactly same POST route worked cryingman for the reason the project is private, i can't show much of the API, but root index.js is something like that, i don't know if that will help... The API is made using Node.Js with Express
Brody
Brody15mo ago
use https before you try anything else
rando
rando15mo ago
does the POST request work locally?
PatuRoco
PatuRoco15mo ago
Yes
Brody
Brody15mo ago
use https when accessing your app through the railway domain, problem solved locking thread now