File tree 1 file changed +9
-10
lines changed
1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -442,18 +442,17 @@ to the `http` module passed to it. For instance:
442
442
' use strict' ;
443
443
const vm = require (' vm' );
444
444
445
- const code =
446
- ` (function(require) {
445
+ const code = `
446
+ (function(require) {
447
+ const http = require('http');
447
448
448
- const http = require('http');
449
+ http.createServer((request, response) => {
450
+ response.writeHead(200, { 'Content-Type': 'text/plain' });
451
+ response.end('Hello World\\ n');
452
+ }).listen(8124);
449
453
450
- http.createServer( (request, response) => {
451
- response.writeHead(200, {'Content-Type': 'text/plain'});
452
- response.end('Hello World\\ n');
453
- }).listen(8124);
454
-
455
- console.log('Server running at http://127.0.0.1:8124/');
456
- })` ;
454
+ console.log('Server running at http://127.0.0.1:8124/');
455
+ })` ;
457
456
458
457
vm .runInThisContext (code)(require);
459
458
```
You can’t perform that action at this time.
0 commit comments