Proxy to Backend

Using the proxy mode of Webpack dev server, it's possible to redirect some URLs to another server. To do so, you must give a configuration file to the --proxy-config option.

For more details on how to use the proxy configuration, please refer to: Webpack Dev Sever - Proxy.

Information

This option is only available with the clea serve command.

Example

Use case:

To do so, you must create a proxy.conf.json file which will contain the following configuration:

{
  "/api": {
    "target": "http://localhost:3000",
    "secure": false
  }
}

Then, launch the following command:

clea serve --proxy-config proxy.conf.json

results matching ""

    No results matching ""