Generic GoLang middleware to reverse proxy SPA development files to allow hot reload functionality while developing.
Any framework can be supported as long as it has development web server to start but additional helpers are available for following frameworks:
NewVueDevProxy
NewReactDevProxy
NewAngularDevProxy
NewSvelteDevProxy
To use proxy instance needs to be created and then started using SpaDevProxy.Start()
method.
Later You can use SpaDevProxy.HandleFunc(w http.ResponseWriter, r *http.Request)
method to add it to applications catch all route that would proxy all not application requests to background development server.
NB! Application need to gracefully shutdown and call SpaDevProxy.Stop()
method otherwise started node background server will not be stopped.
For examples on how to integrate see examples folder: