<?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>DEV Community: Folajimi Fadare</title>
    <description>The latest articles on DEV Community by Folajimi Fadare (@caleb_fadare).</description>
    <link>https://dev.to/caleb_fadare</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%2F1706149%2Fe539f564-7ee5-4045-aa27-57918815c578.jpg</url>
      <title>DEV Community: Folajimi Fadare</title>
      <link>https://dev.to/caleb_fadare</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/caleb_fadare"/>
    <language>en</language>
    <item>
      <title>Tackling CORS Issues: My Backend Development Challenge and HNG Internship Journey</title>
      <dc:creator>Folajimi Fadare</dc:creator>
      <pubDate>Sun, 30 Jun 2024 09:24:33 +0000</pubDate>
      <link>https://dev.to/caleb_fadare/tackling-cors-issues-my-backend-development-challenge-and-hng-internship-journey-3a64</link>
      <guid>https://dev.to/caleb_fadare/tackling-cors-issues-my-backend-development-challenge-and-hng-internship-journey-3a64</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Backend development is a journey filled with challenges and triumphs. Recently, while developing a recipe finder application, I encountered a significant roadblock: Cross-Origin Resource Sharing (CORS) issues. This blog post will explain how I overcame this problem and share my aspirations for the HNG Internship.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;My recipe finder app needed to fetch data from the Spoonacular API, but the browser blocked these requests due to CORS policy restrictions. This issue prevented the app from displaying essential recipe data, rendering it ineffective.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution
&lt;/h2&gt;

&lt;p&gt;To resolve the CORS issue, I implemented a proxy middleware in my React application. Here’s how I did it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Understanding CORS:&lt;br&gt;
CORS is a security feature that prevents unauthorized requests to different domains. Understanding this was crucial to finding a solution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setting Up http-proxy-middleware: I installed http-proxy-middleware in my React&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;project:npm install http-proxy-middleware --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I then created a setupProxy.js file in the src directory and configured the proxy:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function(app) {
    app.use(
        '/api',
        createProxyMiddleware({
            target: 'https://api.spoonacular.com',
            changeOrigin: true,
            pathRewrite: { '^/api': '' },
        })
    );
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Updating API Calls: I updated my API calls to use the proxy:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import axios from 'axios';

const BASE_URL = '/api/recipes/';

export const fetchRecipes = async (ingredients) =&amp;gt; {
    try {
        const response = await axios.get(`${BASE_URL}findByIngredients`, {
            params: {
                ingredients,
                apiKey: 'your_spoonacular_api_key',
            },
        });
        return response.data;
    } catch (error) {
        console.error('Error fetching recipes:', error);
        return [];
    }
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Testing: After configuring the proxy and updating the API calls, I tested the application thoroughly. The CORS issue was resolved, and the app successfully fetched and displayed the recipe data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  My Journey with the HNG Internship
&lt;/h2&gt;

&lt;p&gt;I am excited to start my journey with the HNG Internship. The program offers hands-on experience and mentorship in software development, aligning perfectly with my career goals. Through the internship, I aim to enhance my skills, build a robust portfolio, and connect with industry experts.The HNG Internship emphasizes real-world projects and practical experience, bridging the gap between theoretical knowledge and industry requirements. This structured environment will allow me to apply my knowledge, learn new technologies, and collaborate with like-minded individuals.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Want to Do the HNG Internship
&lt;/h2&gt;

&lt;p&gt;The HNG Internship provides an invaluable platform to develop technical skills and gain insights into the tech industry. The mentorship and feedback from experienced developers will be crucial in shaping my career. I am eager to tackle new challenges, contribute to meaningful projects, and grow as a developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Solving the CORS issue in my recipe finder application was a significant milestone in my backend development journey. It reinforced the importance of perseverance and problem-solving. As I continue this journey with the HNG Internship, I am motivated to tackle new challenges and make meaningful contributions to the tech community.For more information about the HNG Internship and the opportunities it offers, visit &lt;a href="https://hng.tech/internship"&gt;HNG Internship&lt;/a&gt; and &lt;a href="https://hng.tech/hire"&gt;HNG Hire&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you for reading, and I look forward to sharing more of my experiences as I progress through the HNG Internship!&lt;/p&gt;

</description>
      <category>backend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Web Components vs. Vanilla JavaScript: A Niche Comparison in Frontend Technologies</title>
      <dc:creator>Folajimi Fadare</dc:creator>
      <pubDate>Sun, 30 Jun 2024 08:54:00 +0000</pubDate>
      <link>https://dev.to/caleb_fadare/web-components-vs-vanilla-javascript-a-niche-comparison-in-frontend-technologies-34mo</link>
      <guid>https://dev.to/caleb_fadare/web-components-vs-vanilla-javascript-a-niche-comparison-in-frontend-technologies-34mo</guid>
      <description>&lt;p&gt;In the world of frontend development, countless tools help developers create dynamic web applications. While ReactJS is popular—especially here at HNG—it's worth exploring other frontend technologies. Today, we'll compare Web Components and Vanilla JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Components: Building Custom Elements Natively
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Web Components allow developers to create reusable and encapsulated custom HTML elements. These components are supported natively by modern browsers, eliminating the need for external libraries or frameworks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Custom Elements:&lt;/strong&gt; Define and use custom HTML tags.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Shadow DOM:&lt;/strong&gt; Encapsulate component structure and styles, preventing conflicts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML Templates:&lt;/strong&gt; Create reusable template elements that can be cloned and rendered as needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Reusability:&lt;/strong&gt; Components can be used across projects and integrated with various frameworks.&lt;br&gt;
&lt;strong&gt;Encapsulation:&lt;/strong&gt; Shadow DOM ensures styles and scripts are scoped to the component.&lt;br&gt;
&lt;strong&gt;Standards-Based:&lt;/strong&gt; Supported natively by modern browsers for broad compatibility.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Challenges&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Browser Support:&lt;/strong&gt; Older browsers may require polyfills.&lt;br&gt;
&lt;strong&gt;Complexity&lt;/strong&gt;: The API can be more complex compared to high-level frameworks.&lt;br&gt;
&lt;strong&gt;Tooling:&lt;/strong&gt; Less mature ecosystem compared to popular frameworks like React or Vue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vanilla JavaScript: Mastering the Core Language
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vanilla JavaScript refers to using plain JavaScript without additional libraries or frameworks. It offers complete control over the browser's capabilities.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direct DOM Manipulation:&lt;/strong&gt; Work directly with the DOM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No Dependencies:&lt;/strong&gt; No external libraries, reducing overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt; Complete control over your code for optimized solutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; Highly efficient without framework overhead.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core Understanding:&lt;/strong&gt; Deepens knowledge of JavaScript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility:&lt;/strong&gt; Implement exactly what you need without constraints.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Challenges&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Complexity for Large Projects:&lt;/strong&gt; Managing state and updates can be challenging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Boilerplate Code:&lt;/strong&gt; More code for common tasks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Maintenance:&lt;/strong&gt; Harder to maintain consistency without framework conventions.&lt;/p&gt;

&lt;h2&gt;
  
  
  ReactJS at HNG
&lt;/h2&gt;

&lt;p&gt;At HNG, ReactJS is the framework of choice due to its component-based architecture, extensive ecosystem, and active community. During my time at HNG, I look forward to mastering React, building robust applications, and collaborating with fellow developers.The HNG Internship is a fantastic opportunity to grow as a developer. Learn more about the program &lt;a href="https://hng.tech/internship"&gt;here&lt;/a&gt; and explore hiring opportunities &lt;a href="https://hng.tech/hire"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Web Components and Vanilla JavaScript offer unique benefits. Web Components provide a standards-based approach for reusable elements, while Vanilla JavaScript offers unmatched flexibility and performance. Exploring these technologies broadens our understanding and enhances our development skills.Feel free to reach out with any questions. Happy coding!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>webcomponents</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
