MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / writeJson

Function writeJson

yaml-flow-editor/vite.config.ts:49–53  ·  view source on GitHub ↗
(res: ServerResponse, status: number, payload: unknown)

Source from the content-addressed store, hash-verified

47}
48
49function writeJson(res: ServerResponse, status: number, payload: unknown) {
50 res.statusCode = status
51 res.setHeader('Content-Type', 'application/json; charset=utf-8')
52 res.end(JSON.stringify(payload))
53}
54
55function sseWrite(res: ServerResponse, event: string, data: unknown) {
56 res.write(`event: ${event}\n`)

Callers 1

configureServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected