Testing custom webhook url on ephemeral environment

Hi, I'm trying to test a custom webhook endpoint, that is a part of node.js/express app hosted on railway's ephemeral environment. I've created a simple POST endpoint that basically does console.log of request.body. Whenever I try to trigger that api call via TestURL button in the settings/webhooks tab, I can see that there's CORS error thrown:
'https://my-railway-app-on-ephemeral-env.up.railway.app/railway-webhook' from origin 'https://railway.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
'https://my-railway-app-on-ephemeral-env.up.railway.app/railway-webhook' from origin 'https://railway.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Please advise
6 Replies
Percy
Percy2y ago
Project ID: ced0fdc3-bc35-44f0-bf12-c52f42dbf212
andrzej | t2
andrzej | t22y ago
ced0fdc3-bc35-44f0-bf12-c52f42dbf212
Brody
Brody2y ago
The error is pretty self explanatory, add the appropriate header
andrzej | t2
andrzej | t22y ago
🤦‍♂️sorry for wasting your time
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Brody
Brody2y ago
No cross promotion
Want results from more Discord servers?
Add your server