Node.js is an open‑source server environment that runs JavaScript outside the browser.
It uses Google’s V8 engine to execute code, letting you write backend services and APIs in JavaScript.
Node.js lets you execute JavaScript on the server, handle HTTP requests, and serve files—all with code you already know.
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello, TheCodingJourney!');
});
server.listen(8080, () => {
console.log('Server running at http://localhost:8080/');
});