silverwolf-x's picture
download
raw
431 Bytes
import { setTimeout } from 'timers/promises'
export async function GET() {
const encoder = new TextEncoder()
const stream = new ReadableStream({
async start(controller) {
let i = 1
while (true) {
controller.enqueue(encoder.encode(`data: chunk-${i++}\n\n`))
await setTimeout(300)
}
},
})
return new Response(stream, {
headers: { 'Content-Type': 'text/event-stream' },
})
}

Xet Storage Details

Size:
431 Bytes
·
Xet hash:
7bcb2ce17198232d6e20a83c252e4889c701c655b1ff18244b523a6e38736045

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.