download
raw
561 Bytes
'use strict'
const fastify = require('../../fastify')({
logger: false
})
const payload = JSON.stringify({ hello: 'world' })
fastify.get('/', function (req, reply) {
const stream = new ReadableStream({
start (controller) {
controller.enqueue(payload)
controller.close()
}
})
return new Response(stream, {
status: 200,
headers: {
'content-type': 'application/json; charset=utf-8'
}
})
})
fastify.listen({ port: 3000 }, (err, address) => {
if (err) throw err
console.log(`Server listening on ${address}`)
})

Xet Storage Details

Size:
561 Bytes
·
Xet hash:
9569a4e851136112b19c1a895d8bb69fb34dd7e13d963672fa59954630da5656

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