我正在尝试在我的react原生应用程序中使用代理(使用CRNA和Expo构建)。因此,在我的package.json文件中,我输入了:"proxy": "192.168.1.27:8080" and then make simple get request with fetch with the/users` path和react call me network error (他看不到代理参数,我调试时只看到了/users )。如果我把完整的url放进去,fetch请求就能很好地工作。在react (网站)中,我做了同样的事情,那就是工作。
我从React调用Drupal并获得以下错误:
Failed to load http://l-and-d.dd:8083/node?_format=json: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed