Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 74268

How to add parameter to readstream in nodejs?

$
0
0

I want to display a html file when a call is triggered, therefore I tried creating a readfilestream in nodejs and adding the html file to it.

        res.writeHead(200, {'Content-Type': 'text/html'});

        var readStream = fs.createReadStream(__dirname + '/password.html','utf8'); 

        readStream.pipe(res)

It works perfectly fine, but I need to add parameters to the file.

var testParameter= 'test';

I want to display the testParameter variable in my html file. Is this possible?


Viewing all articles
Browse latest Browse all 74268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>