<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Jemarie Baldespiñosa</title>
    <description>The latest articles on Forem by Jemarie Baldespiñosa (@idevkits).</description>
    <link>https://forem.com/idevkits</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1161630%2F24c0e447-1bbe-499b-947e-018e33f67218.jpg</url>
      <title>Forem: Jemarie Baldespiñosa</title>
      <link>https://forem.com/idevkits</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/idevkits"/>
    <language>en</language>
    <item>
      <title>Mastering Custom Middlewares in Express.js: Enhancing Your Node.js Apps</title>
      <dc:creator>Jemarie Baldespiñosa</dc:creator>
      <pubDate>Sat, 30 Sep 2023 02:44:03 +0000</pubDate>
      <link>https://forem.com/idevkits/mastering-custom-middlewares-in-expressjs-enhancing-your-nodejs-apps-3e59</link>
      <guid>https://forem.com/idevkits/mastering-custom-middlewares-in-expressjs-enhancing-your-nodejs-apps-3e59</guid>
      <description>&lt;p&gt;Custom middlewares in Express.js allow you to add your own logic and functionality to the request-response cycle of your application. These middlewares are functions that can be executed before or after route handlers, and they can perform tasks such as authentication, authorization, logging, data validation, and more. Here's how to create and use custom middlewares in Express.js:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Creating a Custom Middleware:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To create a custom middleware, define a function that takes three arguments: &lt;code&gt;req&lt;/code&gt; (the request object), &lt;code&gt;res&lt;/code&gt; (the response object), and &lt;code&gt;next&lt;/code&gt; (a function to call the next middleware in the chain). The &lt;code&gt;next&lt;/code&gt; function is crucial because it allows the middleware to pass control to the next middleware or route handler in the chain.&lt;/p&gt;

&lt;p&gt;Here's an example of a simple custom middleware that logs the current timestamp for every incoming request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;logTimestamp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Request received at &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;()}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
     &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Call the next middleware or route handler&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Using the Custom Middleware:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To use the custom middleware, simply pass it as a function to &lt;code&gt;app.use()&lt;/code&gt; or specify it for a specific route using &lt;code&gt;app.use()&lt;/code&gt; or &lt;code&gt;app.METHOD()&lt;/code&gt;. Here's how you can use the &lt;code&gt;logTimestamp&lt;/code&gt; middleware:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

   &lt;span class="c1"&gt;// Use the custom middleware for all routes&lt;/span&gt;
   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;logTimestamp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

   &lt;span class="c1"&gt;// Define your route handlers&lt;/span&gt;
   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Home Page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;

   &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server is running on port 3000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;logTimestamp&lt;/code&gt; middleware is used for all routes. It logs the timestamp before passing control to the route handler.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Order of Middleware Matters:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The order in which you use middlewares is important. Middlewares are executed in the order they are defined. Be mindful of the order to ensure that the middleware functions are called in the desired sequence.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Conditionally Using Middleware:&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can also conditionally use middleware based on specific routes or conditions. For example, you might want to apply authentication middleware only to certain routes. Use &lt;code&gt;app.use()&lt;/code&gt; or &lt;code&gt;app.METHOD()&lt;/code&gt; as needed to apply middleware selectively.&lt;/p&gt;

&lt;p&gt;Custom middlewares in Express.js provide a flexible way to add functionality and logic to your application at various stages of the request-response cycle. You can create as many custom middlewares as needed to suit the requirements of your application.&lt;/p&gt;




&lt;p&gt;*&lt;em&gt;TRUE LEARNERS WOUDN'T QUIT *&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;"Embrace the journey of learning. Every step forward is a step toward greatness."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Learning is the key that unlocks the doors to a world of possibilities."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Challenge yourself to learn something new every day, and watch your potential unfold."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"In the world of knowledge, there are no shortcuts. Every lesson learned is a stepping stone to success."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Don't be afraid to stumble. Every mistake is a lesson, and every lesson makes you stronger."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Education is your passport to a brighter future. Invest in yourself and watch your dreams take flight."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Learning is not a destination; it's a lifelong journey. Keep moving forward."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"The pursuit of knowledge is a noble endeavor. Let curiosity be your guide."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Believe in your ability to learn, grow, and achieve. The sky is not the limit; it's just the beginning."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Education is the foundation upon which you can build anything. Start today and build your dreams."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-&lt;em&gt;Jemarie Baldespiñosa&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Middleware: The Hidden Hero of Web Development</title>
      <dc:creator>Jemarie Baldespiñosa</dc:creator>
      <pubDate>Thu, 28 Sep 2023 05:08:31 +0000</pubDate>
      <link>https://forem.com/idevkits/middleware-the-hidden-hero-of-web-development-1an7</link>
      <guid>https://forem.com/idevkits/middleware-the-hidden-hero-of-web-development-1an7</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;INTRODUCTION:&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Middleware in web development refers to a set of functions or processes that are executed between receiving an HTTP request and sending an HTTP response in a web application. Middlewares act as intermediaries that can perform various tasks such as request processing, authentication, authorization, logging, error handling, and more. They are an integral part of many web frameworks and are used to enhance the functionality and security of web applications.&lt;/p&gt;

&lt;p&gt;Here is an introduction to middlewares in web development:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Request-Response Flow:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In a typical web application, a client (such as a web browser) sends an HTTP request to a server. The server processes the request and sends back an HTTP response. This flow involves multiple steps, and middlewares are executed at various stages of this process.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Middleware Chain:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Middlewares are organized in a chain, where each middleware function in the chain has access to the request and response objects and can perform its specific task. The order in which middlewares are executed matters, as they can modify the request or response data.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Common Uses of Middlewares:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Logging:&lt;/strong&gt; Middleware can log incoming requests, including details like the request method, URL, headers, and timestamps. This is valuable for debugging and monitoring.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authentication:&lt;/strong&gt; Middleware can check whether a user is authenticated before allowing access to protected routes. It can validate user credentials, tokens, or session data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Authorization:&lt;/strong&gt; Middleware can verify whether the authenticated user has the necessary permissions to access certain resources or perform specific actions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validation:&lt;/strong&gt; Middleware can validate incoming data, such as form submissions or API payloads, to ensure it meets certain criteria or constraints.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Error Handling:&lt;/strong&gt; Middleware can catch and handle errors that occur during request processing. It can send appropriate error responses to the client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CORS (Cross-Origin Resource Sharing):&lt;/strong&gt; Middleware can handle CORS headers to control which domains are allowed to access resources on the server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compression:&lt;/strong&gt; Middleware can compress response data to reduce bandwidth usage and improve page load times.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Session Management:&lt;/strong&gt; Middleware can manage user sessions, maintaining user-specific data between requests.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Express.js and Middleware:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;In Node.js, the Express.js web framework is a popular choice for building web applications. Express makes extensive use of middlewares. You can use built-in middlewares or create custom ones to add functionality to your Express application.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;For example, you can use the &lt;code&gt;express.json()&lt;/code&gt; middleware to parse incoming JSON data, or you can use the &lt;code&gt;express.static()&lt;/code&gt; middleware to serve static files like CSS, JavaScript, and images.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Custom Middlewares:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Developers often create custom middlewares tailored to the specific needs of their applications. Custom middlewares can perform tasks such as data validation, authentication checks, or custom logging.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Middleware Execution Order:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The order in which middlewares are added to the middleware chain matters. Middlewares are executed in the order they are defined. This can affect the behavior of your application, so it's important to carefully consider the order.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In summary, middlewares play a crucial role in web development by enabling developers to add functionality and logic to the request-response cycle of web applications. They provide a way to modularize and enhance the behavior of web servers, making it easier to implement features like authentication, authorization, and error handling while keeping the codebase clean and maintainable.__&lt;/p&gt;

&lt;p&gt;"Why did the developer start using middlewares? Because they realized that even in the 'middle' of challenges, they could 'ware' their coding skills and conquer anything!" 😄🚀&lt;br&gt;
&lt;strong&gt;-Jemarie B.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>newbie</category>
      <category>oxyjem</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HTTP Request</title>
      <dc:creator>Jemarie Baldespiñosa</dc:creator>
      <pubDate>Tue, 26 Sep 2023 05:44:30 +0000</pubDate>
      <link>https://forem.com/idevkits/http-request-2ajd</link>
      <guid>https://forem.com/idevkits/http-request-2ajd</guid>
      <description>&lt;p&gt;An HTTP request is a message sent from a client (typically a web browser) to a web server, requesting a specific action to be performed or a resource to be retrieved. HTTP (Hypertext Transfer Protocol) is the foundation of data communication on the World Wide Web, and it defines a set of rules for how requests and responses should be formatted and handled.&lt;/p&gt;

&lt;p&gt;HTTP requests consist of several key components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;HTTP Method (Verb):&lt;/strong&gt; The method indicates the type of request being made and what action should be taken by the server. Common HTTP methods include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET&lt;/code&gt;: Retrieve data from the server.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST&lt;/code&gt;: Send data to the server to create a new resource.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PUT&lt;/code&gt;: Update an existing resource on the server.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DELETE&lt;/code&gt;: Remove a resource from the server.&lt;/li&gt;
&lt;li&gt;And others like &lt;code&gt;PATCH&lt;/code&gt;, &lt;code&gt;HEAD&lt;/code&gt;, &lt;code&gt;OPTIONS&lt;/code&gt;, etc.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Request URL (Uniform Resource Locator):&lt;/strong&gt; The URL specifies the address of the resource the client wants to interact with. It includes the protocol (e.g., &lt;code&gt;http://&lt;/code&gt; or &lt;code&gt;https://&lt;/code&gt;), domain name (e.g., &lt;code&gt;example.com&lt;/code&gt;), path (e.g., &lt;code&gt;/products/123&lt;/code&gt;), and optional query parameters (e.g., &lt;code&gt;?search=query&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HTTP Headers:&lt;/strong&gt; Headers provide additional information about the request or the client making the request. Common headers include &lt;code&gt;User-Agent&lt;/code&gt; (information about the client), &lt;code&gt;Accept&lt;/code&gt; (the types of responses the client can handle), and &lt;code&gt;Authorization&lt;/code&gt; (authentication credentials).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Request Body (Optional):&lt;/strong&gt; For some HTTP methods like &lt;code&gt;POST&lt;/code&gt; and &lt;code&gt;PUT&lt;/code&gt;, a request may include a body containing data or content that the server should process or store. The format of the request body depends on the content type specified in the &lt;code&gt;Content-Type&lt;/code&gt; header.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here's an example of a simple HTTP request using the &lt;code&gt;GET&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/products/123&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;example.com&lt;/span&gt;
&lt;span class="na"&gt;User-Agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36&lt;/span&gt;
&lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8&lt;/span&gt;
&lt;span class="na"&gt;Accept-Language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;en-US,en;q=0.9&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the client is requesting the resource located at &lt;code&gt;/products/123&lt;/code&gt; on the &lt;code&gt;example.com&lt;/code&gt; server using the &lt;code&gt;GET&lt;/code&gt; method. The request includes headers describing the client and the types of responses it can handle.&lt;/p&gt;

&lt;p&gt;The server processes the request, performs the requested action (e.g., retrieving product details), and sends an HTTP response back to the client with the requested data or indicating the result of the action.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LET'S DIVE DEEPER&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTP (Hypertext Transfer Protocol) requests are a fundamental part of web communication, and they come in various forms and are used for various purposes. Let's dive deeper into some essential concepts and components of HTTP requests:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTTP Methods (HTTP Verbs):&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GET:&lt;/strong&gt; Used to request data from a specified resource. For example, when you open a web page in your browser, it sends a &lt;code&gt;GET&lt;/code&gt; request to the server to retrieve the page's content.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;POST:&lt;/strong&gt; Used to send data to the server for processing. Commonly used when submitting forms or sending data to create a new resource on the server, like submitting a login form.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PUT:&lt;/strong&gt; Used to update a resource or create it if it doesn't exist. It typically sends data to update an existing resource at the specified URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DELETE:&lt;/strong&gt; Used to request the removal of a resource at the specified URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;PATCH:&lt;/strong&gt; Used to partially update a resource. It sends data to modify only specific parts of a resource, leaving the rest unchanged.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;HEAD:&lt;/strong&gt; Similar to &lt;code&gt;GET&lt;/code&gt;, but it only requests the headers of the response, not the actual data. This is often used to check if a resource has changed since the last request.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;OPTIONS:&lt;/strong&gt; Used to retrieve information about the communication options available for a resource. It's commonly used to check which HTTP methods are allowed for a resource.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Request Headers:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;HTTP request headers provide additional information about the request, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;User-Agent&lt;/code&gt;: Identifies the client making the request (e.g., the web browser or HTTP client).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Accept&lt;/code&gt;: Specifies the types of responses the client can handle (e.g., JSON, HTML).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Authorization&lt;/code&gt;: Provides authentication credentials if required.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Content-Type&lt;/code&gt;: Indicates the media type of the request body when sending data (e.g., &lt;code&gt;application/json&lt;/code&gt;, &lt;code&gt;text/html&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Request URL and Path:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The URL (Uniform Resource Locator) specifies the complete address of the resource being requested.&lt;/li&gt;
&lt;li&gt;The path part of the URL indicates the location of the resource on the server. For example, in &lt;code&gt;https://example.com/products/123&lt;/code&gt;, &lt;code&gt;/products/123&lt;/code&gt; is the path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Request Body:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For HTTP methods like &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, and &lt;code&gt;PATCH&lt;/code&gt;, a request can include a body that contains data to be processed by the server. The format and content of the body depend on the request's &lt;code&gt;Content-Type&lt;/code&gt; header.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Query Parameters:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Query parameters can be included in the URL to provide additional information to the server. They are typically used for filtering, sorting, or customizing the response. For example, in &lt;code&gt;https://example.com/search?q=keyword&amp;amp;page=1&lt;/code&gt;, &lt;code&gt;q&lt;/code&gt; and &lt;code&gt;page&lt;/code&gt; are query parameters.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Cookies and Sessions:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HTTP requests can include cookies, which are small pieces of data stored on the client's side and sent with each request. Cookies are often used for session management and tracking user interactions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Status Codes and Responses:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After processing an HTTP request, the server sends an HTTP response back to the client. The response includes a status code (e.g., 200 OK, 404 Not Found) that indicates the result of the request.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;HTTP requests and responses are essential for client-server communication on the web, enabling the retrieval of web pages, API interactions, and much more. Understanding these components is crucial for web developers working with web applications and services.&lt;/p&gt;

</description>
      <category>newbie</category>
      <category>webdev</category>
      <category>oxyjem</category>
    </item>
    <item>
      <title>Binary Newbie Coder's Dreams</title>
      <dc:creator>Jemarie Baldespiñosa</dc:creator>
      <pubDate>Wed, 20 Sep 2023 09:04:12 +0000</pubDate>
      <link>https://forem.com/idevkits/binary-newbie-coders-dreams-45f5</link>
      <guid>https://forem.com/idevkits/binary-newbie-coders-dreams-45f5</guid>
      <description>&lt;p&gt;THIS SONG WILL CELEBRATE THE WORLD OF CODING, THE PASSION OF CODERS AND THE JOURNEY OF TURNING INDEAS INTO SOFTWARE:)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(Verse 1)&lt;/strong&gt;&lt;br&gt;
In the world of code, we craft our dreams, &lt;br&gt;
Lines of logic, like flowing streams. &lt;br&gt;
From "Hello, World!" to the grandest scheme, &lt;br&gt;
We're the architects of the digital scene.&lt;br&gt;
&lt;strong&gt;(Chorus)&lt;/strong&gt;&lt;br&gt;
 We're coding through the night and day, &lt;br&gt;
Debugging errors that come our way. &lt;br&gt;
In binary and bytes, we find our play, &lt;br&gt;
In this coder's world, we're here to stay.&lt;br&gt;
&lt;strong&gt;(Verse 2)&lt;/strong&gt;&lt;br&gt;
 Syntax errors, they test our might, &lt;br&gt;
But we're not giving up without a fight. &lt;br&gt;
With every bug, we gain insight,&lt;br&gt;
 Coding's a journey, not just a flight.&lt;br&gt;
&lt;strong&gt;(Chorus)&lt;/strong&gt;&lt;br&gt;
 We're coding through the night and day,&lt;br&gt;
 Debugging errors that come our way. &lt;br&gt;
In binary and bytes, we find our play, &lt;br&gt;
In this coder's world, we're here to stay.&lt;br&gt;
&lt;strong&gt;(Bridge)&lt;/strong&gt; &lt;br&gt;
From Python's grace to JavaScript's &lt;br&gt;
thrill, We bend the languages to our will. &lt;br&gt;
We're the creators, with skills to fill, &lt;br&gt;
The digital canvas, with code we instill.&lt;br&gt;
&lt;strong&gt;(Chorus)&lt;/strong&gt;&lt;br&gt;
 We're coding through the night and day,&lt;br&gt;
Debugging errors that come our way. &lt;br&gt;
In binary and bytes, we find our play, &lt;br&gt;
In this coder's world, we're here to stay.&lt;br&gt;
&lt;strong&gt;(Outro)&lt;/strong&gt;&lt;br&gt;
 So here's to the coders, the ones who dare, &lt;br&gt;
To transform ideas into software. &lt;br&gt;
In the realm of code, we're a special pair,&lt;br&gt;
 Building the future, with lines that care.&lt;/p&gt;

&lt;p&gt;--------------------------------------------...&lt;br&gt;
Thank you so much, I hope you enjoy it!&lt;br&gt;
&lt;strong&gt;ORIGINAL LYRICS&lt;/strong&gt;||&lt;strong&gt;ORIGINAL LYRICS&lt;/strong&gt;&lt;br&gt;
-Jemarie Baldespiñosa&lt;/p&gt;

</description>
      <category>codenewbie</category>
      <category>codersonglyrics</category>
      <category>jemwebkey</category>
      <category>programming</category>
    </item>
    <item>
      <title>"Step-by-Step Guide to Building an Express server in Node.js"</title>
      <dc:creator>Jemarie Baldespiñosa</dc:creator>
      <pubDate>Wed, 20 Sep 2023 07:59:20 +0000</pubDate>
      <link>https://forem.com/idevkits/step-by-step-guide-to-building-an-express-server-in-nodejs-3geg</link>
      <guid>https://forem.com/idevkits/step-by-step-guide-to-building-an-express-server-in-nodejs-3geg</guid>
      <description>&lt;p&gt;Creating your first Node.js + Express server is a great project to start with! Here's a step-by-step guide to help you get started:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Set Up Your Development Environment&lt;/strong&gt;&lt;br&gt;
Before you begin, make sure you have Node.js and npm (Node Package Manager) installed on your computer. You can download and install them from the official Node.js website: &lt;a href="https://nodejs.org/" rel="noopener noreferrer"&gt;https://nodejs.org/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create a Project Directory&lt;/strong&gt;&lt;br&gt;
Create a new directory for your project. You can do this using your computer's file explorer or by running the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;my-express-server
&lt;span class="nb"&gt;cd &lt;/span&gt;my-express-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Initialize a Node.js Project&lt;/strong&gt;&lt;br&gt;
Inside your project directory, initialize a new Node.js project by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a &lt;code&gt;package.json&lt;/code&gt; file that will store information about your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Install Express&lt;/strong&gt;&lt;br&gt;
Now, let's install Express as a dependency for your project. In your terminal, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;express &lt;span class="nt"&gt;--save&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Create Your Server File&lt;/strong&gt;&lt;br&gt;
Create a JavaScript file for your Express server. You can name it &lt;code&gt;server.js&lt;/code&gt; or something similar. In this file, you'll write the code for your server.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Write Your Express Server Code&lt;/strong&gt;&lt;br&gt;
Here's a basic example of an Express server in &lt;code&gt;server.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Define a route&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, Express World!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Start the server&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server is running on http://localhost:&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;port&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code creates an Express server that listens on port 3000 and responds with "Hello, Express World!" when you access the root URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Start Your Express Server&lt;/strong&gt;&lt;br&gt;
In your terminal, navigate to your project directory and run your server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the message "Server is running on &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;" in your terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Test Your Server&lt;/strong&gt;&lt;br&gt;
Open a web browser or use a tool like Postman to visit &lt;code&gt;http://localhost:3000&lt;/code&gt; in your browser. You should see the "Hello, Express World!" message.&lt;br&gt;
-------------------------------------------------...&lt;br&gt;
Congratulations! You've created your first Node.js + Express server. From here, you can continue to build and expand your server by adding more routes, middleware, and functionality to suit your project's needs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STARTING YOUR JOURNEY: NODE.JS AND EXPRESS SERVERE CREATION&lt;/strong&gt; -Jemarie Baldespiñosa&lt;/p&gt;

</description>
      <category>node</category>
      <category>webdev</category>
      <category>jemwebkey</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
