I want to use polymer serve
to serve my LitElement app during development without waiting for polymer build
to finish after every change. However, the app uses relative URLs for API access, like GET /api/api_method
, and AFAIK I can't make polymer serve
and my server work on the same port (e.g. localhost:8080
).
Currently I run polymer build
and then run my local Python server, which serves the Polymer files as static.
The ideal scenario would be:
$ run_my_server.sh --port=8081
$ polymer serve --api_server="localhost:8081"
Then for routes that are found in the polymer build directory they would be served, otherwise the request would be routed to localhost:8081
.
Are there any other ways to setup the local dev process without rebuilding the whole app after every change?