standardised the api response, updated contribute
This commit is contained in:
9
server-node/src/utils/endpoint-utils.js
Normal file
9
server-node/src/utils/endpoint-utils.js
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
export function respondWithBinaryPdf(res, buffer, filename) {
|
||||
res.writeHead(200, {
|
||||
'Content-Type': "application/pdf",
|
||||
'Content-disposition': 'attachment;filename=' + filename,
|
||||
'Content-Length': buffer.length
|
||||
});
|
||||
res.end(Buffer.from(buffer, 'binary'))
|
||||
}
|
||||
Reference in New Issue
Block a user