3 ms·
Do you deploy just the JS to a CDN or a whole website? I wanted to do something similar, throw a static website on a CDN and use a Go API as its backend. But un
by overbytecode 3y ago
Do you deploy just the JS to a CDN or a whole website? I wanted to do something similar, throw a static website on a CDN and use a Go API as its backend. But unsure how to get around CORS in a reliable way.
- fireant 3y agoYou setup CORS on your backend, it does not matter where or how you frontend works. IMO biggest problem is that if your website is public facing, then just having an SPA is bad for crawlers and not great for UX.
- moomoo11 3y agoYou whitelist domains that can access your server (in my case I have env vars with whitelisted domains list that the Go code picks up) and that should be all you need to do.