I am trying to replicate the next.js code to svelte
https://vercel.com/docs/storage/vercel-blob/using-blob-sdk#upload
It asks for giving a path to run a server side function which I don't know about implementing in svelte
handleUploadUrl Yes* A string specifying the route to call for generating client tokens for client uploads.
Next.js Version
const newBlob = await upload(file.name, file, { access: 'public', handleUploadUrl: '/api/avatar/upload', });
Let me know how I can provide a url which exports a function to carry out
onBeforeGenerateToken
onUploadCompleted
I have my secret key as an environment variable.
I have tried to put a file in the routes directory, but I am getting an error which says path not found.