-
Notifications
You must be signed in to change notification settings - Fork 10
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
VueGlue implies vue support, what should I use for svelte? #1
Comments
It's actually the same as with Vue or React. First, let's make sure you actually need vite-go. If you're developing a single page application where you're using a Go backend for the API, you don't really need to use this module. You can just use Vite directly, possibly setting up Vite to proxy over to your Go api server. The best reason to use the module is if you're developing a Go web app that uses Go's templating system, and you want to enhance that UI with Svelte; vite-go makes this pretty easy. Is that what you're trying to do? |
No, I do not really need the templating part. I just want to streamline the development and deployment flow of a svelte frontend with go-gin backend. |
I'm assuming that go-gin exposes a REST backend (haven't used gin yet myself). So you probably just need to set up Vite as a proxy server for your gin API. Here's the place to start with in the docs. |
I was thinking more towards a) getting vite to proxy when under dev and using the built code as a static route when built for production. b) getting both of those to auto-reload |
Why is it optimal to proxy requests via vite? |
Mostly this prevents the browser from getting annoyed by cross-domain requests during development. You can certainly configure this yourself, but it's kind of a PITA. Having Vite handle this for you eliminates this problem.
I'm guessing you mean this feature of Vite. I'll admit I'm not familiar with this feature, so I'm not sure if it's "in scope" or not :-). Unless you mean instead using vite-go to render a production build? |
Trying out the repo with a svelte app. Confused as to how to set it up.
The text was updated successfully, but these errors were encountered: