-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi, very nice lib, I'm using it, works. I need help. Here is what I have, just some debug code that does nothing:
const transformerFunction = function (data, req, res) {
for(var prop in req) {
console.log(prop) // to see if I can tell the query string.
}
//<script src="/reload/reload.js"></script>
let str = data.toString('utf8')
console.log(str)
return Buffer.from( str, 'utf8' )
}
How do I work with buffer?
First I want to ignore anything that is not dealing with html, eg: images and just return.
What is a good way to detect css, images, etc?
Second, if it might be html, I want to append string <script src="/reload/reload.js"></script> to in the middle of the response string. I plan just to use string functions.
I am not worried about performance as this is a dev server.
Do I need to assemble all the buffers somehow into a full body string?
nickwesselman
Metadata
Metadata
Assignees
Labels
No labels