Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pub serve to fall back to a different backend server #16851

Closed
DartBot opened this issue Feb 15, 2014 · 5 comments
Closed

Allow pub serve to fall back to a different backend server #16851

DartBot opened this issue Feb 15, 2014 · 5 comments

Comments

@DartBot
Copy link

DartBot commented Feb 15, 2014

This issue was originally filed by sheran...@gmail.com


I would like to add a feature in "pub serve" that provides proxying functionality to connect to a different back-end. Thus the intended high-level flow of a request from Dartium would look similar to:

  1. User request from Dartium goes to BarbackServer
  2. BarbackServer searches for an appropriate local asset
  3. If one is not found, and the 'pub serve' argument '--proxy' is set then forward the request to the server pointed to by --proxy
  4. If the response is a 404, then continue with the usual BarbackServer 404 handling
  5. If there is a response, pick it up, then write it back to the response

I believe this would help folks who would like to use the DartEditor to build and test their code, but would like to use a different back-end server. By having their requests fall back to a proxied back-end server, they will not have to leave the Dart Editor or Dartium. Also, during production deployments, there would not be a need to change any code. This would only be useful when front and back end are on the same server.

Please let me know if this is sound and useful or if I am looking at the whole dev cycle incorrectly.

@DartBot
Copy link
Author

DartBot commented Feb 15, 2014

This comment was originally written by sher...@gmail.com


Sorry, that should be an enhancement, not a defect.

@kevmoo
Copy link
Member

kevmoo commented Feb 15, 2014

Removed Type-Defect label.
Added Type-Enhancement, Pub-Serve, Triaged labels.
Changed the title to: "Allow pub serve to fall back to a different backend server".

@lrhn
Copy link
Member

lrhn commented Feb 16, 2014

Added Area-Pub label.

@nex3
Copy link
Member

nex3 commented Feb 18, 2014

I believe this would help folks who would like to use the DartEditor to build and test their code, but would like to use a different back-end server.

This is a use-case we care about, but I don't think this is likely to be how we address it. When integrating with an external server, it's important that we give that server a lot of control over where and how the Dart assets are presented, since integration requirements vary wildly from person to person. That suggests that doing this in reverse -- having the application server proxy to the barback server -- is a better strategy than having "pub serve" itself do the proxying, which requires that the Dart assets be served from the root of the directory.


Added NotPlanned label.

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/pub#866.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants