fetch('/graphql')without worrying about redirecting them to another host or port during development.
proxyfield to your
package.json, for example:
fetch('/graphql')in development, the development server will recognize that it’s not a static asset and will proxy your request to
http://localhost:4000/graphqlas a fallback. The development server will only attempt to send requests without
Acceptheader to the proxy.
proxyoption is not flexible enough for you, you can get direct access to the Express app instance and hook up your own proxy middleware.
package.json, but it is recommended you consolidate all of your logic into
http-proxy-middlewareusing npm or Yarn:
src/setupProxy.jsand place the following contents in it:
requirefield of your application's
composer.jsonto your server's root
composer.jsonand execute the