<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Y Dhanush on Medium]]></title>
        <description><![CDATA[Stories by Y Dhanush on Medium]]></description>
        <link>https://medium.com/@dhanushsaireddy8?source=rss-7c1dd76d64c0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FLWHBb9p4w0vgBS4cGHx0g.png</url>
            <title>Stories by Y Dhanush on Medium</title>
            <link>https://medium.com/@dhanushsaireddy8?source=rss-7c1dd76d64c0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 12 Jun 2026 02:26:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dhanushsaireddy8/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Understanding the Journey of a URL: Exploring HTTP Methods and Status Codes]]></title>
            <link>https://medium.com/@dhanushsaireddy8/understanding-the-journey-of-a-url-exploring-http-methods-and-status-codes-7d43ee1b5b7b?source=rss-7c1dd76d64c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d43ee1b5b7b</guid>
            <category><![CDATA[website]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[http-status-code]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Y Dhanush]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 10:14:16 GMT</pubDate>
            <atom:updated>2024-02-22T10:15:17.847Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oOR0brEi7sms6ZZb.png" /></figure><h4>Introduction:</h4><p>In the vast landscape of the internet, every time we enter a URL into our browser’s address bar and hit enter, a complex series of interactions occurs behind the scenes. From DNS resolution to server processing, and from HTTP methods to status codes, each step plays a crucial role in delivering the requested web content to our screens. In this blog post, we’ll delve into the fascinating journey of a URL, exploring the intricacies of HTTP methods and status codes along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*EEJatN9A1v9-u8nh.jpeg" /></figure><h4>DNS Resolution:</h4><p>The journey begins with DNS (Domain Name System) resolution. When we type a URL, such as “<a href="http://www.example.com">www.example.com</a>,&quot; into our browser, it first needs to translate this human-readable domain name into an IP (Internet Protocol) address. This process involves querying DNS servers to find the corresponding IP address associated with the domain name. Once obtained, this IP address serves as the destination for our request.</p><h4>Establishing a TCP Connection:</h4><p>Armed with the IP address, our browser initiates a TCP (Transmission Control Protocol) connection to the server hosting the requested web resource. TCP ensures reliable, ordered, and error-checked delivery of data between the client (our browser) and the server. Typically, this connection occurs over port 80 for HTTP or port 443 for HTTPS.</p><h4>HTTP Request:</h4><p>With the TCP connection established, our browser crafts an HTTP request to fetch the desired resource. This request contains crucial information, including the HTTP method (such as GET, POST, PUT, DELETE) and the specific resource’s path identified by the URL. For example, a GET request fetches a resource, while a POST request submits data to be processed by the server.</p><h4>Server Processing:</h4><p>Upon receiving the HTTP request, the server springs into action. It parses the request, examines the method, and determines how to handle the requested resource. If the resource exists and the server can fulfill the request, it prepares an HTTP response. However, if there’s an issue, such as a missing resource or authentication failure, the server generates an appropriate error response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*SrcgcjjSwywQHdOV.png" /></figure><h4>HTTP Response:</h4><p>The server sends back an HTTP response to our browser, containing vital information encapsulated in the HTTP status code. These status codes convey the outcome of the request, whether it was successful, redirected, or encountered an error. For instance, a status code of 200 indicates success (OK), while 404 signifies that the requested resource was not found (Not Found).</p><h4>Browser Rendering:</h4><p>Finally, our browser receives the HTTP response and processes it accordingly. If the status code indicates success, the browser renders the content received from the server, displaying the webpage as intended. However, if an error occurred, such as a 404 Not Found, the browser handles the response appropriately, often displaying an error page to the user.</p><h3>HTTP Status Codes</h3><p>HTTP status codes are an essential component of the Hypertext Transfer Protocol (HTTP), governing the communication between web servers and clients. These three-digit numerical codes provide valuable information about the outcome of a client’s request, ranging from success to various types of errors. In this comprehensive guide, we’ll delve into the world of HTTP status codes, exploring their categories, common codes, and their significance in web development and troubleshooting.</p><h4>Understanding HTTP Status Codes:</h4><p>HTTP status codes are divided into five categories, each indicating a specific class of response from the server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*mYltWqmpzyXzZr4O.jpeg" /></figure><h4>Common HTTP Status Codes:</h4><p>Now, let’s explore some of the most commonly encountered HTTP status codes and their meanings:</p><p><strong>200 OK</strong>: The request was successful, and the server has returned the requested resource.<br><strong>301 Moved Permanently</strong>: The requested resource has been permanently moved to a new URL.<br><strong>400 Bad Request</strong>: The server cannot process the request due to malformed syntax or invalid parameters.<br><strong>404 Not Found</strong>: The requested resource could not be found on the server.<br><strong>500 Internal Server Error</strong>: A generic error message indicating that something has gone wrong on the server’s end.<br><strong>503 Service Unavailable</strong>: The server is temporarily unable to handle the request due to maintenance or overload.</p><p><strong>Significance in Web Development:</strong></p><p>HTTP status codes play a crucial role in web development, aiding developers in debugging and troubleshooting issues. By examining the status codes returned by the server, developers can identify and resolve issues related to resource availability, authentication, and server configuration.</p><h4><strong>Best Practices:</strong></h4><p>When developing web applications, it’s essential to handle HTTP status codes gracefully. Providing meaningful error messages and appropriate responses enhances the user experience and facilitates troubleshooting for both developers and users.</p><h4>Conclusion:</h4><p>In conclusion, the journey of a URL is a fascinating expedition through the intricacies of networking protocols, server-client interactions, and web standards. Understanding the role of HTTP methods and status codes sheds light on how web browsers communicate with servers to retrieve and display web content seamlessly. Next time you enter a URL, take a moment to appreciate the journey it embarks upon, traversing the vast expanse of the internet to bring you the desired information.</p><p><strong>Connect with me</strong> : <a href="https://linktr.ee/ydhanush8">https://linktr.ee/ydhanush8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d43ee1b5b7b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Resolving CORS Issues in Express and React.js: A Comprehensive Guide]]></title>
            <link>https://medium.com/@dhanushsaireddy8/resolving-cors-issues-in-express-and-react-js-a-comprehensive-guide-31ca5d58f90b?source=rss-7c1dd76d64c0------2</link>
            <guid isPermaLink="false">https://medium.com/p/31ca5d58f90b</guid>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[solutions]]></category>
            <category><![CDATA[expressjs]]></category>
            <dc:creator><![CDATA[Y Dhanush]]></dc:creator>
            <pubDate>Thu, 15 Feb 2024 02:07:16 GMT</pubDate>
            <atom:updated>2024-02-15T02:43:45.109Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I0QD8Q9zJVjQtZHvLOGHaw.png" /></figure><h3><strong>Introduction:</strong></h3><p>During the development of my latest project, “My Book Intel,” an innovative platform designed to help users store and annotate their reading experiences, I encountered a significant roadblock: Cross-Origin Resource Sharing (CORS) issues. “My Book Intel” serves to document the books they’ve read, adding their thoughts, insights, and key takeaways to enrich their reading journey. However, as I delved into crafting this platform, integrating a frontend built with React.js and a backend powered by Express.js, CORS complexities arose, hindering the seamless interaction between these components. In this article, I’ll share my experiences navigating through the CORS challenges encountered during the development of “My Book Intel,” and provide comprehensive solutions and code examples to overcome these obstacles in both Express and React.js environments.</p><p>My project “<a href="https://github.com/ydhanush8/my-book-intel">My Book Intel</a>”.</p><p>Cross-Origin Resource Sharing (CORS) issues often arise when connecting a backend, typically built with Express.js, to a frontend, commonly developed with React.js. CORS restrictions exist to protect web applications from unauthorized access, but they can sometimes hinder communication between different origins. In this guide, we’ll explore several methods to resolve CORS problems in Express and React.js, along with code examples for each approach.</p><h3>Solutions for CORS issue:</h3><p><strong>1. Configuring CORS in Express.js:</strong><br> Express.js provides middleware to handle CORS headers effectively. You can use the `cors` package to configure CORS in your Express server. Here’s how you can do it:</p><pre>// Install cors package: npm install cors<br> const express = require(&#39;express&#39;);<br> const cors = require(&#39;cors&#39;);<br>const app = express();<br>// Enable CORS for all routes<br> app.use(cors());<br>// Your routes and other middleware definitions are here…<br>app.listen(3001, () =&gt; {<br> console.log(&#39;Server is running on port 3001&#39;);<br> });</pre><p><strong>2. Proxying Requests in React.js:</strong><br>React.js applications often run on a different port or domain from the backend server, leading to CORS issues. To bypass this, you can set up a proxy in the React app’s `package.json` file:</p><pre>{<br> &quot;name&quot;: &quot;my-react-app&quot;,<br> &quot;version&quot;: &quot;0.1.0&quot;,<br> &quot;proxy&quot;: &quot;http://localhost:3001&quot; // Point to your Express server<br> }</pre><p>This configuration allows requests from the React app to be proxied through the development server to the Express backend, avoiding CORS restrictions.</p><p><strong>3. Custom CORS Handling in Express:</strong><br>For more fine-grained control over CORS policies, you can implement custom middleware in Express. This approach allows you to specify CORS headers based on your specific requirements. Here’s a basic example:</p><pre>// Custom CORS middleware<br> app.use((req, res, next) =&gt; {<br> res.setHeader(&#39;Access-Control-Allow-Origin&#39;, &#39;*&#39;); // Allow requests from any origin<br> res.setHeader(&#39;Access-Control-Allow-Methods&#39;, &#39;GET, POST, PUT, DELETE&#39;);<br> res.setHeader(&#39;Access-Control-Allow-Headers&#39;, &#39;Content-Type, Authorization&#39;);<br> next();<br> });</pre><p>Adjust the headers according to your needs, such as restricting the allowed origins or methods.</p><p><strong>4. Handling CORS in Production:</strong><br>In production environments, you should configure CORS carefully to ensure security. Consider setting specific origins, methods, and headers based on your application’s requirements. You can use environment variables or configuration files to manage CORS settings dynamically.</p><h3>Conclusion:</h3><p>CORS issues can be frustrating when developing applications that involve communication between the frontend and backend. However, by following the approaches outlined above, you can effectively resolve CORS problems in Express and React.js projects. Whether you choose to configure CORS in Express, proxy requests in React, or implement custom middleware, addressing CORS concerns is crucial for seamless communication between client and server components.</p><p>My Links : <a href="https://linktr.ee/ydhanush8">https://linktr.ee/ydhanush8</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31ca5d58f90b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>