Skip to content

Commit

Permalink
doc: refine spaces in example from vm.md
Browse files Browse the repository at this point in the history
PR-URL: nodejs#13334
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
vsemozhetbyt committed Jun 2, 2017
1 parent 4191962 commit a235e67
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,18 +442,17 @@ to the `http` module passed to it. For instance:
'use strict';
const vm = require('vm');

const code =
`(function(require) {
const code = `
(function(require) {
const http = require('http');
const http = require('http');
http.createServer((request, response) => {
response.writeHead(200, { 'Content-Type': 'text/plain' });
response.end('Hello World\\n');
}).listen(8124);
http.createServer( (request, response) => {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\\n');
}).listen(8124);
console.log('Server running at http://127.0.0.1:8124/');
})`;
console.log('Server running at http://127.0.0.1:8124/');
})`;

vm.runInThisContext(code)(require);
```
Expand Down

0 comments on commit a235e67

Please sign in to comment.