CORS Error on Client Side API Call

Wappler Version : 4.0.1
Operating System : Win 10 Pro
Server Model: NodeJS
Database Type: NA
Hosting Type: localhost

when calling an API from client side like this:

<dmx-api-action id="api1" url="https://webhook.site/d40e9001-8d33-40ed-94cb-1d38ba2570fd" method="post" dmx-bind:data="{est:'set',setset:'fgh'}"></dmx-api-action>

we are getting CORS error:
image

this is on localhost:3000

Please help to resolve this.

Does this help @nshkrsh

About two thirds down is some sample code you may be able to employ:

thanks for this. maybe this will help - will share with the Devs on the job. am a mere mortal who dont speak code and prefers if this was magically possible to be done via Wappler natively!

You can try using the Wappler CORS settings and define the remote hosts or use a wildcard such as * to allow for all origins. Then set your methods.

Can be found in Server Connect and click the settings cog:

1 Like