MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / sendText

Function sendText

src/lib/run.js:521–529  ·  view source on GitHub ↗

* Sends text * @param {string} text * @param {string} id * @param {string} mimeType * @param {(txt: string) => string} processText

(text, id, mimeType, processText)

Source from the content-addressed store, hash-verified

519 * @param {(txt: string) => string} processText
520 */
521 function sendText(text, id, mimeType, processText) {
522 webServer?.send(id, {
523 status: 200,
524 body: processText ? processText(text) : text,
525 headers: {
526 "Content-Type": mimeType || "text/html",
527 },
528 });
529 }
530
531 /**
532 * Opens the preview in browser

Callers 4

handleRequestFunction · 0.85
sendByExtFunction · 0.85
sendHTMLFunction · 0.85
sendFileContentFunction · 0.85

Calls 1

sendMethod · 0.65

Tested by

no test coverage detected