How to configure proxy server in polymer cli
Asked Answered
H

3

7

Is there any way to configure proxy server in polymer-cli ? similar to webpack-dev-server proxy. I've check any possible documentation with no success

Hieratic answered 4/8, 2016 at 2:57 Comment(0)
D
5

There are two proxy options you can set when running polymer serve:

--proxy-path string Top-level path that should be redirected to the proxy-target. E.g. api/v1 when you want to redirect all requests of https://localhost/api/v1/.

--proxy-target string Host URL to proxy to, for example https://myredirect:8080/foo.

Starting with a proxy would look something like:

polymer serve --proxy-target http://localhost:3000 --proxy-path api
Downswing answered 28/4, 2018 at 11:0 Comment(0)
F
0

to configure polymer-cli proxy in Linux, just set environment variable:

if you using bash,

export http_proxy="http://[proxy_host]:[port]"
export https_proxy=$http_proxy
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$http_proxy
Fenian answered 17/3, 2017 at 11:16 Comment(0)
M
0

Polymer uses bower. You can set proxy for bower and it will works fine. create .bowerrc in your current project and add these lines :

{ "directory": "bower_components", "proxy": "http://yourProxy:yourPort", "https-proxy":"http://yourProxy:yourPort", "no-proxy":"myserver.mydomain.com" }

Moreville answered 31/5, 2017 at 9:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.