ok, interesting, Im on the phone with my backend now. Nothing has changed on the server side and we were hitting it earlier say 30 days ago before the last wappler update. On the backend side my team has hit it with a success return from a browser, python code, etc… so really not sure how to resolve this.
You were hitting it 30 days ago because you were performing the API Action on Wappler’s back-end (NodeJS) instead of the front-end (your browser). NodeJS doesn’t care about CORS, CORS only applies to browsers, so that’s why
Your backend team can hit with a success because they’re accessing the API directly or otherwise using Postman or something. If they were to create an HTML page and host it on a different domain name, they’d hit the same CORS issue
CORS is a safety mechanism to prevent third-party websites from hitting your API and doing things like /logout or /transferMoney
In this situation, your front-end is a third-party relative to where the back-end is located (e.g.: different IP address or domain name)
I agree with you but how am I able to hit it with the return coming back to me within the API Action via workflow?
I just did this two seconds ago, see the image.
but if I do the same thing via the API form… No dice
- In the screenshot in particular, Wappler UI is doing that request, not your front-end nor back-end
- Your Wappler back-end can do the request without problems because it’s not affected by CORS, as CORS is a safety mechanism on browsers. Your front-end could access your (Wappler) back-end because it’s the same origin
- Doing the same thing through an API Form your front-end is accessing your team’s back-end which is on a different origin
This article explains nicely:
If you want your back-end team to have an easy fix, they must add this to their response headers:
Access-Control-Allow-Origin: *
This is explained in depth (along with security risks of such) on the article I linked above ![]()
Ideally, they would whitelist just localhost/127.0.0.1 and where you have the front-end hosted
Buddy, thanks again, so sorry if I am a bother… We are going to work this out. I see what you are saying.
Its much appreciated!
