R
Railwayβ€’16mo ago
ayden!!

Server not receiving requests, always returns 404.

Project ID: 1ca4e1b0-a98a-48de-b470-0b771a59a88b For some reason whenever I send a post request to my server it will return 404 as if there is nothing listening on that endpoint even though the server is configured to listen on said endpoint. I've tried redeploying, recreating the service, recreating the project with no avail. The source code for my project is located here if you think it may be a code issue but I seriously cannot find out why this is happening. https://github.com/LuauProgrammer/payhip-to-parcel-whitelist/tree/master
GitHub
GitHub - LuauProgrammer/payhip-to-parcel-whitelist
Contribute to LuauProgrammer/payhip-to-parcel-whitelist development by creating an account on GitHub.
22 Replies
Percy
Percyβ€’16mo ago
Project ID: 1ca4e1b0-a98a-48de-b470-0b771a59a88b
ayden!!
ayden!!β€’16mo ago
Brody
Brodyβ€’16mo ago
uncropped screenshot please
ayden!!
ayden!!β€’16mo ago
ayden!!
ayden!!β€’16mo ago
Even though there should be headers and a body, the server should still get the request and return 400 as thats what its designed to do if theyre not present.
Brody
Brodyβ€’16mo ago
send me the url please
ayden!!
ayden!!β€’16mo ago
If you're wondering what the server actually does, its supposed to receive a webhook from Payhip ( https://help.payhip.com/article/115-webhooks?_gl=1*1sv5izw*_ga*MzE4NDE2Mjg2LjE2OTE0MjIwNDA.*_ga_FQNQ7EMCFF*MTY5MTUyNjg5NC4yLjEuMTY5MTUyNzMzNi4yNS4wLjA ) and then whitelist the customer
Webhooks
Webhooks allow you to set up integrations which subscribe to certain events from your Payhip store. Currently, the only event available is the successful transa
ayden!!
ayden!!β€’16mo ago
I setup a mock server with Postman and Payhip is sending the webhook but the whitelist server doesn't receive it.
Brody
Brodyβ€’16mo ago
i assume this works locally?
ayden!!
ayden!!β€’16mo ago
Worked locally last time I did an actual change to the source code I merged a pull request but it was just a semver version bump Everything was working fine until railway changed their plans and the server went down
Brody
Brodyβ€’16mo ago
can you show me a screenshot of your service variables?
ayden!!
ayden!!β€’16mo ago
Mind if I DM you it? I have API keys in my variables
Brody
Brodyβ€’16mo ago
i dont want to see your keys lol keep them hidden
ayden!!
ayden!!β€’16mo ago
Brody
Brodyβ€’16mo ago
haha i do wanna see the webhook route though
ayden!!
ayden!!β€’16mo ago
Brody
Brodyβ€’16mo ago
im pretty sure you want that to start with a forward slash
ayden!!
ayden!!β€’16mo ago
I'll try service is redeploying gonna send a post request then ill get back to u ur actually kidding meee omg wtf ur a life saver i actually wouldve never thought of that i swear i made it automatically add a foward slash to the route but ig not
Brody
Brodyβ€’16mo ago
const WEBHOOK_ROUTE = process.env.WEBHOOK_ROUTE || "/" this means use process.env.WEBHOOK_ROUTE and if that doesn't exist use "/" instead but process.env.WEBHOOK_ROUTE did exist, and it didnt have a prefixed forward slash, so the environment variable was used as you typed it in the railway service variables
ayden!!
ayden!!β€’16mo ago
yeah i know i just didnt realize that tysm for the help
Brody
Brodyβ€’16mo ago
no problem πŸ™‚
Want results from more Discord servers?
Add your server