discuitnet / discuit

A free and open-source community discussion platform.
https://discuit.net
GNU Affero General Public License v3.0
384 stars 40 forks source link

feat: Add development proxy #74

Closed Codycody31 closed 1 month ago

Codycody31 commented 1 month ago

It should make it way easier to work on UI changes rather than having to npm run build:local on every update.

previnder commented 1 month ago

If this is based on the suggestion by @pH_low, then I might've understood it in a different way. I got the idea that he was asking for a proxy to route all API requests to a non-local server, so that he doesn't have to setup Discuit in full on his local machine to work on just the front-end.

Codycody31 commented 1 month ago

I believe what @pH_low needed could be solved another way but similarly, where a proxy has the UI served while also proxying /api and /images to the development server running elsewhere. But this is primarily to make it easier to work on the UI, as at least when I have to do it, I make my relevant changes, then re-build the UI, as don't believe on the UI I am able to change to URL it goes to for the API. So with this, I can now proxy the UI to run on the same local port as the API so it can talk to it correctly

previnder commented 1 month ago

Understood. Could you rename DevProxy in config.Config into something like UIProxy or StaticProxy so that it's clear that the proxy is for the UI?

Codycody31 commented 1 month ago

Renamed it from DevProxy to UIProxy