Fading Coder

One Final Commit for the Last Sprint

Practical Notes for Getting Started with JeecgBoot Low-Code Development

After obtaining the source code from the official site, follow the setup instructions to launch the front-end and back-end components of the decoupled project. Environment Constraints On Windows 7, Node.js must be version 10 or earlier; newer releases are incompatible. When using MySQL, executing th...

Preventing SQL Injection in Node.js and MySQL Applications

Overview While it is rare to build backends directly using raw Node.js today, understanding SQL injection attacks is still valuable. This article uses Node.js and MySQL to explain SQL injection vulnerabilities and how to mitigate them. SQL injection is an ancient attack that has existed since the ad...

Managing HTTP Cookies in Node.js

Cookies remain a relevant mechanism for storing small amounts of string data in web applications, despite the prevalence of LocalStorage and SessionStorage. In HTTP communication, cookies are automatically included in requests sent from the client to the server, and servers can set cookies with broa...

Building a Basic HTTP Server with Node.js

To verify Node.js installlation, run the version check command: node --version A Node.js application consists of three core components: Module imports using require() Server creation to handle client requests Request/resopnse handlign logic Here's how to create a simple HTTP server: const server = r...

Real-Time Streaming with Server-Sent Events for AI Chat Interfaces

Server-Sent Events (SSE) establish a unidirectional, persistent connection enabling servers to push real-time data to browsers. Although an older specification, SSE has seen a massive resurgence as the backbone for streaming text generation in modern AI applications. Core Concepts Event Stream: A se...

Building Web Servers with Express: Routing and Middleware Explained

Express is a web application framework for Node.js, designed for building web servers and APIs efficiently. It simplifies development compared to using Node.js's native http module directly, similar to how jQuery abstracts browser APIs. Setting Up Express Install Express in your project directory: n...

Reading and Writing Files in Node.js

File manipulation is a fundamental server-side feature and an essential skill for backend development. File operations primarily involve reading and writing. Node.js provides built-in methods for these tasks, which you can invoke directly. Creating Directories Synchronous Method const fileSystem = r...

Comparing File Reading in Node.js: Native fs Module vs. then-fs Package

Native fs Module in Node.js The built-in fs module in Node.js provides file system operations using callback functions. Here's an example of reading a file: const fs = require('fs'); fs.readFile('./data/file.txt', 'utf8', (error, data) => { if (error) { console.error('Error reading file:', error)...

Installing and Configuring Node.js on Windows

Node.js Overview and Download 1. Runtime Environments, Compilers, and Development Tools A runtime environment provides the necessary components to execute code, including a core compiler. Node.js is a JavaScript runtime environment. In contrast, an Integrated Development Environment (IDE) like Visua...

Understanding Node.js Streams for Efficient Data Handling

Streams in Node.js are a core abstraction for handling data flow, particularly useful when dealing with large files, video, audio, or network communications. They allow data to be processed in chunks as it becomes available, rather than loading antire datasets into memory at once. Consider a scenari...