4/12/2024
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows you to run JavaScript on the server side, making it possible to build full-stack applications with a single language.
First, install Node.js from the official website. Then create a simple server:
const http = require("http");
const server = http.createServer((req, res) => {
res.writeHead(200, { "Content-Type": "text/plain" });
res.end("Hello World!");
});
server.listen(3000, () => {
console.log("Server running on port 3000");
});
Node.js has revolutionized server-side development and continues to be a popular choice for modern applications.