Html5 eventSource and node express issues

  node.js, question

I want to use EventSource in html5 to make an access real-time log, the code is as follows:

app.get('/access', function(req, res) {
 var access_file = fs.readFile('./access.log',{"enconding":"utf-8"}, function(err, data) {
 if(err) {
 return false;
 var str = new Buffer(data);
 var str_array = str.toString().split("::");
 res.render('admin/access_page', {
 "result": str_array

After the Content-Type is changed, html cannot be output. How can I get what I want?

Although it was last year’s question, I still answered it.
In fact, the html mentioned by the title owner is just a character string in nature, while the so-called “unable to output html” does not exist, just transfer the html character string according to the specified format of SSE:

//SSE fixed format for transmitting data: "data:" plus data to be transmitted plus "\n\n"
 Res.write("data: "add" here, fill in the html string "add" \n\n ");