V
V
vasya0922021-12-20 08:22:36
PHP
vasya092, 2021-12-20 08:22:36

What is pre-backend, preback, backend script?

It is necessary to integrate CDEK with a WordPress site. At this stage of solving the problem, I just need to connect the map (I connected it from Yandex maps) and display the SDEC labels on it. And there was a problem, the SDEK API is not ready to accept requests from the browser, giving CORS errors. As tech put it. support:

Errors of the CORS type say that requests cannot be sent from the browser to us. And it is necessary to make a layer (preback, backend script) and then requests will be processed correctly from the backend. and headers are not needed.


To be honest, I don’t really understand what it is and tried to google it. I did not find any information about this on the Internet. Maybe there is some source with information about what this preback is and how to do it, preferably also in wordpress? Or how would you solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-12-20
@vasya092

You need to make a proxy for your site.
This is just a php file that makes a request to SDEC and returns the result to your script, because it is on your domain and on the same port, CORS does not limit it and everything works.
Here is one example
https://dzone.com/articles/building-simple-api-proxy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question