u/standardhypocrite

Keeping a WebSocket connection alive with a serverless backend

I have a statically hosted dashboard that needs to display real-time stock prices. I want to use WebSockets, but my backend is entirely serverless functions. Since serverless functions die after the request finishes, how do you handle persistent WebSocket connections? Do I have to spin up a dedicated VPS just for the socket server?

reddit.com
u/standardhypocrite — 7 days ago

Edge function proxies for HTTP-only cookies on a static host

I want to use proper HTTP-only cookies for authentication, but I don't have a traditional backend. I am thinking of using an Edge function to act as a proxy. It intercepts the login request, calls an external Auth0 API, takes the JWT, sets it as an HTTP-only cookie, and redirects the user back to the static site. Has anyone implemented this? Does it feel too brittle?

reddit.com
u/standardhypocrite — 10 days ago

I am using Contentful with a statically exported Nuxt site. The client wants to preview their drafts before hitting publish. Next.js has a built in draft mode, but for a pure static export, I have no server to render the draft on the fly. Am I forced to set up a completely separate staging environment that builds on every single keystroke?

reddit.com
u/standardhypocrite — 19 days ago

I have a monorepo with three different Astro static sites sharing a UI component library. Locally, Turborepo caches the builds perfectly. But on my cloud host, the cache misses every single time and rebuilds all three sites from scratch even if I only changed a markdown file in one of them. How do you guys persist monorepo build caches across serverless deployments?

reddit.com
u/standardhypocrite — 25 days ago