{
    "content": "<h1>Express.js API Reference<\/h1><p><a href=\"..\/Express\/\">Express<\/a> is a minimal and flexible <a href=\"..\/Node.js\/\">Node.js<\/a> web application framework that provides a robust set of features for web and mobile applications. The <a href=\"..\/Express\/\">Express<\/a> API is structured around several core objects that facilitate the handling of <a href=\"..\/HTTP\/\">HTTP<\/a> requests and the generation of responses.<\/p><h2>The Application Object<\/h2><p>The <code>app<\/code> object, typically created by calling the top-level <code>express()<\/code> function, is the heart of an <a href=\"..\/Express\/\">Express<\/a> application. It provides methods for <a href=\"..\/Routing\/\">Routing<\/a> <a href=\"..\/HTTP\/\">HTTP<\/a> requests, such as <code>app.get()<\/code> and <code>app.post()<\/code>, and for configuring <a href=\"..\/Middleware\/\">Middleware<\/a> using <code>app.use()<\/code>. It also allows developers to set application settings and render HTML views using template engines.<\/p><h2>Request and Response Objects<\/h2><p>In every route handler, <a href=\"..\/Express\/\">Express<\/a> provides a <code>req<\/code> (Request) object and a <code>res<\/code> (Response) object. The <code>req<\/code> object contains information about the <a href=\"..\/HTTP\/\">HTTP<\/a> request, including query strings, parameters, body data, and <a href=\"..\/HTTP\/\">HTTP<\/a> headers. Conversely, the <code>res<\/code> object represents the <a href=\"..\/HTTP\/\">HTTP<\/a> response that an <a href=\"..\/Express\/\">Express<\/a> app sends when it gets an <a href=\"..\/HTTP\/\">HTTP<\/a> request. Methods like <code>res.send()<\/code>, <code>res.json()<\/code>, and <code>res.status()<\/code> are essential for controlling the output sent back to the client.<\/p><h2>The Router Object<\/h2><p>A <code>router<\/code> object is an isolated instance of <a href=\"..\/Middleware\/\">Middleware<\/a> and routes. It can be thought of as a \"mini-application,\" capable only of performing <a href=\"..\/Middleware\/\">Middleware<\/a> and routing functions. This is a powerful way to organize large applications into modular, maintainable chunks. The <a href=\"..\/Express\/\">Express<\/a> <code>Router<\/code> helps in creating complex <a href=\"..\/REST-API\/\">REST-API<\/a> structures by grouping related routes under a common prefix.<\/p><h2>Middleware Integration<\/h2><p><a href=\"..\/Middleware\/\">Middleware<\/a> functions are functions that have access to the request object, the response object, and the <code>next<\/code> middleware function in the application’s request-response cycle. These functions can execute code, make changes to the request and response objects, end the request-response cycle, and call the next middleware in the stack.<\/p><p>For comprehensive technical details, refer to the <a href=\"https:\/\/expressjs.com\/en\/4x\/api.html\">Official Express.js Documentation<\/a>.<\/p><ul><li><a href=\"..\/Node.js\/\">Node.js<\/a><\/li><li><a href=\"..\/REST-API\/\">REST-API<\/a><\/li><li><a href=\"..\/Middleware\/\">Middleware<\/a><\/li><li><a href=\"..\/JavaScript\/\">JavaScript<\/a><\/li><\/ul>",
    "tags": [
        "express",
        "nodejs",
        "api",
        "backend",
        "javascript",
        "web-framework",
        "routing",
        "middleware",
        "http",
        "server-side"
    ]
}