Programming

Programming

Exploring Various Coding Languages

Programming LanguagesSoftware DevelopmentAlgorithms and Data StructuresSoftware EngineeringWeb and Mobile Programming

Articles in this Section

NextRequest and NextResponse in Next.js — Managing Cookies, Headers, Redirects, and Rewrites

Next.js extends the native Web Request and Response APIs with NextRequest and NextResponse, offering powerful tools for managing cookies, headers, redirects, rewrites, and JSON responses. These utilities simplify server-side logic and improve control over routing, personalization, and security. This guide walks through their capabilities with practical examples and best practices.

/article/nextjs-nextrequest-nextresponse-cookies-headers-redirect-rewrite-api

redirect and refresh in Next.js — Smart Redirects and Client Refreshing via Server Actions

The redirect function in Next.js allows you to navigate users to a new route, returning either a 307 or 303 HTTP response depending on context. It works in Server Components, Client Components, Route Handlers, and Server Actions. The refresh function is used exclusively within Server Actions to refresh the client router. This article explains how both functions work, with practical examples and key considerations.

/article/nextjs-redirect-refresh-server-actions-client-router-http-status

Handling Authorization and Caching in Next.js: A Developer’s Guide

Next.js introduces powerful experimental features for access control and smart caching. This guide covers the unauthorized() function for custom 401 handling, unstable_cache for persistent memoization, updateTag for instant cache invalidation, and useLinkStatus for inline navigation feedback. Learn how to use these tools to build secure, performant, and responsive applications.

/article/nextjs-authorization-caching-unauthorized-updateTag-unstableCache-useLinkStatus

Advanced Client-Side Routing and Performance Hooks in Next.js

Next.js provides a rich set of client-side hooks and caching utilities that empower developers to build dynamic, responsive, and secure applications. From reading route parameters to tracking navigation state and reporting performance metrics, this guide walks you through the most important tools available in the App Router.

/article/nextjs-client-hooks-routing-performance-useParams-useRouter-updateTag

Routing in Express.js: A Complete Guide to Application Endpoints

Routing in Express.js defines how an application responds to incoming HTTP requests at specific paths (URIs) and methods. This flexible system allows developers to create simple routes, complex patterns, dynamic parameters, multiple handlers, and modular route structures using Router. This article explains all essential routing concepts—from basic paths to regex routes, route parameters, middleware-style handlers, app.route(), and express.Router.

/article/routing-in-expressjs-a-complete-guide-to-application-endpoints

Routing در Express.js تعیین می‌کند که برنامه چگونه به درخواست‌های

Routing در Express.js تعیین می‌کند که برنامه چگونه به درخواست‌های HTTP در مسیرهای مختلف پاسخ دهد. این سیستم قدرتمند و انعطاف‌پذیر امکان تعریف مسیرهای ساده، الگوهای پیچیده، پارامترهای پویا، چندین هندلر، و ساختارهای ماژولار مبتنی بر Router را فراهم می‌کند. این مقاله تمام مفاهیم کلیدی Routing—از مسیرهای ساده تا Regex، پارامترها، middleware، app.route() و express.Router—را به‌صورت کامل و کاربردی توضیح می‌دهد.

/article/routing-in-expressjs-a-complete-guide-to-application-endpoints-fa

Writing Middleware in Express.js: A Complete Guide for Developers

Middleware is one of the core architectural concepts in Express.js. . Middleware functions have access to the request object (req), the response object (res), and the next() function, which controls the flow of the request–response cycle. Middleware can modify requests, send responses, validate data, log activity, handle errors, or pass control to the next function in the stack. This article explains everything you need to know about writing middleware—from simple examples to async validation, error handling, and configurable middleware.

/article/writing-middleware-in-expressjs-a-complete-guide-for-developers

Using Middleware in Express.js: A Complete and Practical Guide

Using Middleware in Express.js: A Complete and Practical Guide

/article/using-middleware-in-expressjs-a-complete-and-practical-guide

Overriding the Express API and Using Template Engines

Overriding the Express API and Using Template Engines

/article/overriding-the-express-api-and-using-template-engines

Advanced Express.js: Overriding the API, Template Engines, Debugging, and Working Behind Proxies

Advanced Express.js: Overriding the API, Template Engines, Debugging, and Working Behind Proxies

/article/advanced-expressjs-overriding-the-api-template-engines-debugging-and-working-behind-proxies

Database Integration in Express.js: A Complete Guide to Popular Node.js Database Drivers

Express.js does not include built‑in database support, but its flexibility allows you to connect it to virtually any database system simply by installing the appropriate Node.js driver. This article provides a complete overview of how to integrate Express with many popular SQL and NoSQL databases, including installation commands and example usage.

/article/database-integration-in-expressjs-a-complete-guide-to-popular-nodejs-database-drivers

The Assert Module in Node.js: A Complete Guide

The node:assert module provides a set of assertion functions for verifying invariants in Node.js applications. It supports both strict and legacy modes, throwing an AssertionError when conditions fail. The module also includes the AssertionError and Assert classes, which allow for advanced customization and independent assertion instances.

/article/the-assert-module-in-nodejs-a-complete-guide