SudoSOS Back-end API / helpers / sendPdfOrHtml
Function: sendPdfOrHtml() ​
ts
function sendPdfOrHtml(
res,
buffer,
baseName,
fileType
): void;Send a rendered document as an attachment with the content type and extension that match its file type.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
res | Response | The express response |
buffer | Buffer | The PDF or HTML bytes |
baseName | string | File name without extension |
fileType | ReturnFileType | Whether the buffer is the PDF or the raw HTML |
Returns ​
void