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
Ability to proxy requests when serving with trunk serve #29
Comments
Related issue in Seeder: (see point 3.) MartinKavik/seeder#1 Personally, I run front-end and back-end on different domains and ports so I don't need it. However I can imagine it's useful e.g. for server dashboards. |
😂 lolz Ok, feature request to support proxying requests to a backend, probably based on URI prefix (eg, (edit: I suggest this in case you need an immediate solution) BTW, I'm not sure how much experience you have on this front, but there are actually lots of other ways solve this problem, especially given the fact that when you ship an application to a production environment, you will not (you should not) be using Trunk as the web server.
There are other simple patterns as well which are designed for development environments (docker-compose comes to mind), but which closely mirror a production environment. All that said, adding a proxy to Trunk is a good idea. I'll get this prioritized soon. |
My experience from Seed community
|
That's well said. I agree. Beginners would definitely be overwhelmed at having to setup K8s ingresses or Traefik/nginx &c. I definitely don't want to recommend anything like that as "the way" to work with Trunk. Definitely going to setup some proxy functionality. I suppose, in the name of due diligence, what do you all (@MartinKavik && @hamza1311, and anyone else of course) see as being fundamentally need for this?
Anything else which you think is needed here? |
Note: Fetch and SSE should be relatively easy to pass through proxy, however I would be careful with non-HTTP protocols like WebSockets. |
People also sometimes run a single instance of their API server and don't want to setup K8s of all things on their workstation for something as simple as an API proxy. |
@hamza1311 btw, I meant to ask you this earlier, but are you interested in contributing the code for this? I am about 3 days or so out from being able to switch gears over to the next milestone for trunk, and anyone willing to contribute would be greatly appreciated. No pressure, for sure. But I figured I would ask you and let you know that your code is WELCOME! Just let me know. If not, I should be able to get around to it here quite soon. Cheers! |
@thedodd Its not like I don't want to. I don't think I have the knowledge to work on it (I'm willing to learn if you want to help out) or (in the near future) much time to work on it. If that's fine with you, then sure, it's worth a shot |
Currently, the development server spawned with
trunk serve
doesn't allow proxying requests. This renders it mostly useless as API calls to backend can't be made from the app served by the development server.The text was updated successfully, but these errors were encountered: