L12.๐ Node.js โ Handling Forms with Expressimport express from 'express'; const app = express(); // When I enter a name, it will be displayed in the URL like this: // http://localhost:1000/?name=sahana&email= // To handle this kind of form data, we need middleware. // For this, we use built...Jun 9, 2025ยท2 min read
L7. โก๏ธ Starting with Express.js โ Node.js Framework// In Node.js, creating APIs needs a lot of code ๐งฑ // So we use a framework -> Express.js for optimized code ๐ก console.log("Starting with Express.js"); // Install express using npm ๐ฆ // Command: npm i express // Express gets added into node_mod...Jun 2, 2025ยท1 min read
L6. ๐งญ Node.js โ Basic Routing Example// ROUTING IN NODE JS ๐ // If the user hits any URL, that content should be displayed console.log("Routing in Node.js"); import http from 'http'; // use http module to create server // Create server ๐ง const server = http.createServer((req, res) ...May 30, 2025ยท1 min read
L5. ๐ Node.js โ Building a Basic Server// BUIDING SERVER ๐ป // Node.js says to keep server.js as main file // Server means backend ๐ console.log("Creating server..."); import http from 'http'; // use http module to create server // Method to create server ๐ง const server = http.create...May 30, 2025ยท2 min read
L4. Path Module in Node.js1. Importing Path Module console.log("Path Module"); import path from 'path'; path is a built-in module in Node.js. Helps handle and transform file paths easily. 2. Joining Paths const fullPath = path.join('/path', 's.txt', 's.json'); consol...Mar 17, 2025ยท1 min read
L3. File Handling in Node.jsconsole.log("File Handling"); 1. File System Module (fs/promises) Asynchronous File System Operations using promises. Import necessary functions: import { readFile, writeFile, appendFile, mkdir } from "fs/promises"; Functions and their uses: ...Mar 17, 2025ยท2 min read
L2. Node.js Modules & Import/Export1. Initializing a Project npm init -y Automatically generates package.json without asking for details. 2. What are Modules? Functions saved in different files and imported where needed. Helps organize code better. 3. Writing and Using Modules ...Mar 16, 2025ยท1 min read