Topic: What is Node.js?
Topic: Setting Up Node.js Environment
node -v and npm -vTopic: Understanding the Node.js Architecture
Topic: Writing Your First Node.js Program
Creating a simple JavaScript file (hello.js)
console.log("Hello, Node.js!");
Running the file using Node.js
node hello.js
Topic: Building a Simple Web Server
Importing the HTTP module
Creating and running a basic server
const http = require('http');
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello, World!\\\\n');
});
server.listen(3000, '127.0.0.1', () => {
console.log('Server running at <http://127.0.0.1:3000/>');
});
Testing the server in a web browser