有没有办法在polymer-cli中配置代理服务器?类似于webpack-dev-server代理.我检查了任何可能的文档都没有成功
小智 5
运行聚合物服务时,您可以设置两个代理选项:
--proxy-path string
应重定向到代理目标的顶级路径。例如,api/v1当您想重定向https://localhost/api/v1/.
--proxy-target string
要代理的主机 URL,例如https://myredirect:8080/foo.
从代理开始看起来像:
polymer serve --proxy-target http://localhost:3000 --proxy-path api
Run Code Online (Sandbox Code Playgroud)
要在Linux中配置polymer-cli代理,只需设置环境变量:
如果你使用 bash,
export http_proxy="http://[proxy_host]:[port]"
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1882 次 |
| 最近记录: |