Answers for "nodejs hello world"

4

javascript hello world

alert("Hello world");
Posted by: Guest on October-18-2020
0

nodejs hello world

const http = require('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}/`);
});
Posted by: Guest on April-28-2020
3

node js server

const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`))
Posted by: Guest on April-01-2020
0

how to create a javascript hello world program with node.js

console.log('Hello, world');// You can use apostrophes, quotation marks or tildees which are `s
Posted by: Guest on August-18-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language