R
Railway11mo ago
0xdima95

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
Percy11mo ago
Project ID: db735447-598c-455d-b1be-6718e98e1aff
Fragly
Fragly11mo ago
Any errors?
Brody
Brody11mo ago
first thing to try, make sure you are using https when making requests to your app
0xdima95
0xdima95OP11mo 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
Brody11mo ago
alright you are using https, so back to fragly's question
0xdima95
0xdima95OP11mo ago
No description
0xdima95
0xdima95OP11mo 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
Brody11mo ago
i just get a 401 json response
0xdima95
0xdima95OP11mo ago
i can see you attempting to curl it can you send me your command? mines formatted wrong, somehow
Brody
Brody11mo ago
im not using curl
0xdima95
0xdima95OP11mo ago
teach me the ways what ya using
Brody
Brody11mo ago
im using yaak
0xdima95
0xdima95OP11mo ago
is that CLI?
Brody
Brody11mo ago
0xdima95
0xdima95OP11mo ago
downloading still getting 404s what am i doing wrong...
Brody
Brody11mo ago
screenshot please
0xdima95
0xdima95OP11mo ago
No description
Brody
Brody11mo ago
now show me the same thing but posting to your locally running app
0xdima95
0xdima95OP11mo ago
No description
0xdima95
0xdima95OP11mo ago
maybe it's an issue with deployment. idk
Brody
Brody11mo ago
I meant with yaak
0xdima95
0xdima95OP11mo ago
No description
0xdima95
0xdima95OP11mo 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
Brody11mo ago
cant connect to the database?
0xdima95
0xdima95OP11mo ago
omg im sorry its a devops issue over here never deployed the new api code to railway
Brody
Brody11mo ago
haha yeah i knew this wasnt an issue with railway, so no worries
0xdima95
0xdima95OP11mo ago
yeah wow that really threw me for a loop. Thanks for showing me yaak is this abnormal though?
Brody
Brody11mo ago
i dont know what your app does or how you are using the database so i cant say
0xdima95
0xdima95OP11mo ago
does railway have a way of generating docs for an api? or is there anything you'd recommend?
Brody
Brody11mo ago
that wouldnt be something railway would do, so try swagger?
0xdima95
0xdima95OP11mo ago
yeah but you recommended yaak nice product. I've used swagger before
Brody
Brody11mo ago
swagger it is then
Want results from more Discord servers?
Add your server