NodeJS web server hello world

Published: 04 July 2022
on channel: elina k
20
1

// To run the app, download NodeJS from here:
// https://nodejs.org/en/
// or run those commands if you are on Linux
// sudo apt-get install nodejs -y
// node -v
// currently using this version: v12.22.9
//run command: node index.js
// Open in browser: localhost:3000

const http = require("http");
const port = 3000;
const server = http.createServer(function (req, res) {
res.write(
`
Hello NodeJS People!
`
);
res.end();
});
server.listen(port, function (error) {
if (error) {
console.log("Something went wrong", error);
} else {
console.log("Server is listening on port " + port);
}
});


On this page of the site you can watch the video online NodeJS web server hello world with a duration of hours minute second in good quality, which was uploaded by the user elina k 04 July 2022, share the link with friends and acquaintances, this video has already been watched 20 times on youtube and it was liked by 1 viewers. Enjoy your viewing!