Post Requests working locally, not working deployed

Title. This is my first time running an endpoint in railway with a post request. all gets are working fine, and the post worked locally.
32 Replies
Percy
Percy5mo ago
Project ID: db735447-598c-455d-b1be-6718e98e1aff
Fragly
Fragly5mo ago
Any errors?
Brody
Brody5mo ago
first thing to try, make sure you are using https when making requests to your app
0xdima95
0xdima955mo ago
db735447-598c-455d-b1be-6718e98e1aff ill copy the curl command here, sec curl --header "Content-Type:application/json" --header "api-key: fake-api-key" -d '{"queries": [{"wallet_id": "SP1SS7CFBRM82Z1BSWSD6ZEFFEQY6YCSEC1H1235J", "block_height": "132420", "ticker": "stxs"},{"wallet_id": "SPWVKHWDQCPCS3QFYTWGNQYA72WZKQKR41S1N1XF", "block_height": "132416", "ticker": "fess"}]}' -X POST --url "https://satscreener-api.up.railway.app/api/v1/stx20/batch_balance_on_block" some html that says error, cannot POST the exact same query works locally also, unrelated, but i saw people were asking why their bills were projected really high and i also saw a random 3mb network bump in my postgres service metrics Unrelated to that (i know, confusing), i was NOT using private urls which was obviously causing my costs to balloon up. I now use private urls.
Brody
Brody5mo ago
alright you are using https, so back to fragly's question
0xdima95
0xdima955mo ago
No description
0xdima95
0xdima955mo ago
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Error</title> </head> <body> <pre>Cannot POST /api/v1/stx20/batch_balance_on_block</pre> </body> </html> that's the response
Brody
Brody5mo ago
i just get a 401 json response
0xdima95
0xdima955mo ago
i can see you attempting to curl it can you send me your command? mines formatted wrong, somehow
Brody
Brody5mo ago
im not using curl
0xdima95
0xdima955mo ago
teach me the ways what ya using
Brody
Brody5mo ago
im using yaak
0xdima95
0xdima955mo ago
is that CLI?
Brody
Brody5mo ago
0xdima95
0xdima955mo ago
downloading still getting 404s what am i doing wrong...
Brody
Brody5mo ago
screenshot please
0xdima95
0xdima955mo ago
No description
Brody
Brody5mo ago
now show me the same thing but posting to your locally running app
0xdima95
0xdima955mo ago
No description
0xdima95
0xdima955mo ago
maybe it's an issue with deployment. idk
Brody
Brody5mo ago
I meant with yaak
0xdima95
0xdima955mo ago
No description
0xdima95
0xdima955mo ago
it's pointing at a different database, but it doesn't matter since the error is at api level all i did was change the url, everythings the same huh wait it is an issue with the database
Brody
Brody5mo ago
cant connect to the database?
0xdima95
0xdima955mo ago
omg im sorry its a devops issue over here never deployed the new api code to railway
Brody
Brody5mo ago
haha yeah i knew this wasnt an issue with railway, so no worries
0xdima95
0xdima955mo ago
yeah wow that really threw me for a loop. Thanks for showing me yaak is this abnormal though?
Brody
Brody5mo ago
i dont know what your app does or how you are using the database so i cant say
0xdima95
0xdima955mo ago
does railway have a way of generating docs for an api? or is there anything you'd recommend?
Brody
Brody5mo ago
that wouldnt be something railway would do, so try swagger?
0xdima95
0xdima955mo ago
yeah but you recommended yaak nice product. I've used swagger before
Brody
Brody5mo ago
swagger it is then