Mango Juicy
Explore posts from serversCloudflare worker presigned url S3, R2
How do you generate presigned urls or S3 or R2... from cloudflare workers?
Solution:
Use
aws4fetch
package which is designed to work on cloudflare workers:
https://developers.cloudflare.com/r2/examples/aws/aws4fetch/
Do not use @aws-sdk/s3-request-presigner
as this depends on a @smithy
package that requires node:fs
, which is unsupported on Cloudflare. Calling a node:fs
will result in a is not a function
error
PS: I've already found a solution. Though I'd put this here for anybody facing the same issue.1 replies
Client side singleton for heavy resource allocation
Is there a way to create a global singleton for client side without initialising again on page loads?
In my case, I'm preloading a synthesizer on the web, which takes time to load.
Disabling SSR and using only client side routing for subroutes could work.
But how would you do that?
2 replies
Precache service worker
Is there any way to implement service worker for content precaching?
For context I'm creating a website with a midi player. It would be great to precache large (1 to 21 MB ish) SoundFont files.
I've tried using VitePWA plugin in Vinxi. It doesn't appear to register any service workers though.
app.config.ts:
19 replies
createAsync different values on client and server SSR issue
I'm trying to conditionally render components based on auth - think paywalled content.
I have a server function that detects if user has logged in:
However, createAsync returns undefined leading nothing to be rendered on the server:
Server:
Client returns the expected value:
16 replies