[text] http node

Viewer

copydownloadembedprintName: http node
  1. const http = require( 'http' );
  2.  
  3. http.createServer( function ( request, response ) {
  4.         var body = 'Hello  world!';
  5.     response.writeHead( 200, {'Content-Type': 'text/plain'} );
  6.     response.end( body );
  7. }).listen(5050);
  8.  
  9. console.log('Listening to port  5050');

Editor

You can edit this paste and save as new:


File Description
  • http node
  • Paste Code
  • 28 Mar-2024
  • 268 Bytes
You can Share it: