wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.63k stars 1.18k forks source link

Proxy for dev server #1255

Open Zeko369 opened 1 year ago

Zeko369 commented 1 year ago

Since wasp doesn't have a long running node process on the backend in dev (like i.e. next.js) the main server app talks to is killed and restarted all the time -> causing our frontend to not be able to access it and resulting in a bunch of Failed to fetch errors

This can easily be worked around by adding another proxy in front of the main app server, (demo implementation can be found in this repo)

Here is the video example of why this is important and how the demo works

CleanShot 2023-06-15 at 09 59 42@2x

(PS a fun trivia is that while/else and for/else are actually valid python syntax)

Martinsos commented 1 year ago

Thanks @Zeko369 , this makes a lot of sense!

Do you think it is worth it introducing this complexity at the moment? What about other frameworks, do they also have these proxies? This doeas mean we have one more process running on user's machine, right?

Ha, while/else for/else -> I just encountered that a couple months ago while showing my wife python and told her to ignore it for now :D.