Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node js example

const http = require('node:http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello, World!
');
});

server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: react index.jsx example 
Javascript :: turn Iterator into array JS 
Javascript :: add parameter to url without reload jquery 
Javascript :: array map limit javascript 
Javascript :: find all subsets of an array javascript 
Javascript :: scrolltop in javascript 
Javascript :: how to disable keyboard input in javascript 
Javascript :: javascript two digits number 
Javascript :: change image onclick html 
Javascript :: collapse uncollapse jquery 
Javascript :: moment timezone set default timezone 
Javascript :: how to send query parameters in url vuejs 
Javascript :: how to drop collection in mongoose 
Javascript :: javascript indexof 
Javascript :: filereader check file type 
Javascript :: Get the value of text input field 
Javascript :: unsplash 
Javascript :: vs code shows bodyparser deprecated 
Javascript :: http to https redirect express js 
Javascript :: react js loop through array of objects 
Javascript :: modal show with jquery ready function 
Javascript :: syntax function 
Javascript :: ngstyle background url angular 
Javascript :: how to limit characters in number input js 
Javascript :: inheritance in es6 
Javascript :: nodejs event 
Javascript :: random number in javascript between two numbers 
Javascript :: jest expect not contain 
Javascript :: forjs check if key in json 
Javascript :: react native npm run start port 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =