Is there an equivalent of grunt-connect-proxy for Dart / pub ?
In production frontend stuff is built (pub build
) as static resources and can be served by any web server (dart-agnostic).
During development I'd like to communicate with the backend server (non-Dart), without a need to build whole frontend with pub build
and serve it with the backend server just to see some single change in frontend code.
This feature has already been proposed, but as of now it's triaged: https://code.google.com/p/dart/issues/detail?id=16851.
It's seems that this can only be done with pub, since communicating with backend, even within the same host, is done via CORS - at least that is what's encouraged in the docs.
I've spend some time playing with the technology and found a solution that seems to work:
Just pub get
and serve whole content(with subfolders!) of the web
folder with your backend server. Then, open the page in dartium (use backend server socket address). No other servers should host the frontend code. The solution is IDE-agnostic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With