A
A
Andrey Titov2020-01-31 15:41:43
JavaScript
Andrey Titov, 2020-01-31 15:41:43

How to output the content of the plug-in to the browser?

The console displays ...
What is needed to display in the browser?

const http = require('http');

http.createServer(function (req, res) { 
  res.end(http);
  console.log(http);
}).listen(3000);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2020-01-31
@titov_andrei

const http = require('http');
const util = require('util');

http
  .createServer(function(req, res) {
    res.end(util.inspect(http));
  })
  .listen(3000);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question