feat : ajout page monitoring

This commit is contained in:
2026-03-06 15:26:51 +01:00
parent 993524aa72
commit 8b5d4e9655
21 changed files with 11098 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { Readable } from "node:stream"
export default defineEventHandler((event) => {
const size = 128 * 1024 * 1024
let sent = 0
const stream = new Readable({
read(chunkSize) {
if (sent >= size) {
this.push(null)
return
}
const remaining = size - sent
const chunk = Buffer.alloc(Math.min(chunkSize, remaining), "a")
sent += chunk.length
this.push(chunk)
}
})
setHeader(event, "Content-Type", "application/octet-stream")
setHeader(event, "Content-Length", size)
return stream
})