<?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: Dhairya Shah</title>
    <description>The latest articles on DEV Community by Dhairya Shah (@dhairyashah).</description>
    <link>https://dev.to/dhairyashah</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%2F709497%2F4999cdb1-f59d-4fb5-8044-bcd0b07979c1.png</url>
      <title>DEV Community: Dhairya Shah</title>
      <link>https://dev.to/dhairyashah</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhairyashah"/>
    <language>en</language>
    <item>
      <title>Running GTA V on AWS EC2: A Cloud Gaming Experiment That Actually Worked</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Tue, 13 May 2025 09:27:24 +0000</pubDate>
      <link>https://dev.to/dhairyashah/running-gta-v-on-aws-ec2-a-cloud-gaming-experiment-that-actually-worked-4n7j</link>
      <guid>https://dev.to/dhairyashah/running-gta-v-on-aws-ec2-a-cloud-gaming-experiment-that-actually-worked-4n7j</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Ever wondered if you could run &lt;strong&gt;GTA V in the cloud&lt;/strong&gt;—not just stream it via a service, but actually install and run the game yourself on an AWS EC2 instance? That’s exactly what I set out to do. To my surprise, it worked—and it worked well.&lt;/p&gt;

&lt;p&gt;This post is not your average "how to play games on the cloud" guide. It's a story of pushing AWS to its creative limits, experimenting with spot instances, managing EBS volumes like puzzle pieces, and overcoming all the quirks of running a AAA game on virtual hardware—all on a budget of less than $5.&lt;/p&gt;

&lt;p&gt;Let’s dive in.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Research: Is This Even Doable?
&lt;/h3&gt;

&lt;p&gt;Before launching any EC2 instances, I looked into whether it was technically possible. AWS offers &lt;strong&gt;G5 GPU instances&lt;/strong&gt; with NVIDIA GPUs that support DirectX 12, which sounded promising. But there wasn’t much documentation or community experience around installing and running heavy desktop games like GTA V directly on EC2.&lt;/p&gt;

&lt;p&gt;That made the experiment more exciting. I’d be venturing into mostly unexplored territory.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Technical Challenges
&lt;/h3&gt;

&lt;p&gt;Running GTA V in the cloud presents several hurdles:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Large install size&lt;/strong&gt;: Around 120 GB of files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GPU requirements&lt;/strong&gt;: Dedicated graphics power is essential&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: GPU instances aren’t cheap&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform workflow&lt;/strong&gt;: Managing Linux and Windows instances together&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The real challenge turned out to be: how do I download and transfer such a large game efficiently, without spending a fortune?&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation Options Explored
&lt;/h3&gt;

&lt;p&gt;I tried three approaches before landing on the most efficient one.&lt;/p&gt;

&lt;h4&gt;
  
  
  Option 1: Install Directly on a GPU Instance (g5.2xlarge)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Fast GPU, fast network (4–5 Gbps)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Epic Games throttles downloads&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time&lt;/strong&gt;: ~2 hours&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: ~$1.8/hour = too expensive just to install the game&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Option 2: Use a Cheaper EC2 (c5.xlarge)
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pros&lt;/strong&gt;: Costs ~$0.35/hour&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cons&lt;/strong&gt;: Throttling still applies, took ~3 hours to download&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total Cost&lt;/strong&gt;: ~$1.05 — not ideal for budget constraints&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ✅ Option 3: Use a t2.micro with Legendary CLI
&lt;/h4&gt;

&lt;p&gt;This was the breakthrough.&lt;/p&gt;

&lt;p&gt;I launched a &lt;strong&gt;t2.micro Debian spot instance&lt;/strong&gt; (~$0.0016/hour) and used &lt;a href="https://github.com/derrod/legendary" rel="noopener noreferrer"&gt;Legendary&lt;/a&gt;, a CLI Epic Games client, to install the game.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Download time&lt;/strong&gt;: ~3.5 hours&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost&lt;/strong&gt;: &amp;lt;$0.10 total&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Network&lt;/strong&gt;: 1 Gbps (enough for an overnight download)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This worked smoothly, and by the evening I had GTA V fully installed on my EBS volume.&lt;/p&gt;

&lt;h3&gt;
  
  
  Moving Game Files to a Windows Instance
&lt;/h3&gt;

&lt;p&gt;Next, I needed to get the files onto a Windows instance with a GPU.&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="c"&gt;# Install Legendary CLI on Linux&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; python3 python3-pip git
python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
pip3 &lt;span class="nb"&gt;install &lt;/span&gt;legendary-gl

&lt;span class="c"&gt;# Authenticate and install&lt;/span&gt;
legendary auth
legendary &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="s2"&gt;"Grand Theft Auto V"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj29y3w4n5gd4pexuk1tv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj29y3w4n5gd4pexuk1tv.png" alt="Legendary CLI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Mount and Copy Files to an EBS Volume
&lt;/h4&gt;

&lt;p&gt;I attached a new 150 GB EBS volume, formatted it with &lt;strong&gt;exFAT&lt;/strong&gt; for cross-OS support, and copied over the files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mkfs.exfat /dev/xvdf
&lt;span class="nb"&gt;mkdir&lt;/span&gt; /mnt/gamevol
mount /dev/xvdf /mnt/gamevol
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; /path/to/gta5/&lt;span class="k"&gt;*&lt;/span&gt; /mnt/gamevol/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Deal with AZ Mismatch
&lt;/h4&gt;

&lt;p&gt;The t2.micro was in &lt;strong&gt;ap-south-1c&lt;/strong&gt;, but GPU instances were only available in &lt;strong&gt;ap-south-1a/b&lt;/strong&gt;. EBS volumes can't be directly attached across AZs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: I created a &lt;strong&gt;snapshot&lt;/strong&gt; of the volume and restored it into &lt;strong&gt;ap-south-1a&lt;/strong&gt;. It took ~2 hours to get completed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Launching the Windows GPU Instance
&lt;/h3&gt;

&lt;p&gt;I spun up a &lt;strong&gt;g5.2xlarge (Windows Server 2025)&lt;/strong&gt; spot instance and attached the EBS volume. But Windows didn’t like the exFAT filesystem—it prompted a reformat.&lt;/p&gt;

&lt;h4&gt;
  
  
  Pivot to S3
&lt;/h4&gt;

&lt;p&gt;To avoid losing the data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I uploaded the game files to an &lt;strong&gt;S3 bucket&lt;/strong&gt; from a Linux instance&lt;/li&gt;
&lt;li&gt;S3 uploads from EC2 within the same region are &lt;strong&gt;free&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Upload took ~45 minutes
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws s3 &lt;span class="nb"&gt;cp&lt;/span&gt; /mnt/gamevol/ s3://tmp-s3-server/ &lt;span class="nt"&gt;--recursive&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, on the Windows instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;aws&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;sync&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;s3://tmp-s3-server&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;D:\EpicGames&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Final Setup
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf7uyx3jnd3qqc5d6n7f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf7uyx3jnd3qqc5d6n7f.png" alt="Epic Games Launcher on Windows"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once the files were on the Windows machine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installed &lt;strong&gt;NVIDIA drivers&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Installed &lt;strong&gt;Epic Games Launcher&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Pointed the launcher to the game directory&lt;/li&gt;
&lt;li&gt;It started verifying the game files&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Then came an error: &lt;strong&gt;"Unable to update the Rockstar Launcher."&lt;/strong&gt; I assumed Rockstar had detected the VM.&lt;/p&gt;

&lt;h4&gt;
  
  
  The Fix
&lt;/h4&gt;

&lt;p&gt;Turned out to be simple: &lt;strong&gt;Run as Administrator&lt;/strong&gt;. That’s it.&lt;/p&gt;

&lt;p&gt;Once I did that, the launcher updated, and the game launched successfully.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Results
&lt;/h3&gt;

&lt;p&gt;GTA V ran flawlessly on the g5.2xlarge. High settings, smooth graphics, and stable performance.&lt;/p&gt;

&lt;p&gt;This wasn’t just about getting a game to run—it was about using cloud infrastructure creatively and efficiently.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/L7oCZQKdBT8"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Stats
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instances launched&lt;/strong&gt;: 10–15&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total storage used&lt;/strong&gt;: ~1.5 TB across EBS volumes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Game installation cost&lt;/strong&gt;: &amp;lt;$0.10 (thanks to t2.micro spot)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Total project cost&lt;/strong&gt;: Under $5&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance&lt;/strong&gt;: 60+ FPS at high settings&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What I Learned from This Experiment
&lt;/h3&gt;

&lt;p&gt;This hands-on project taught me more about AWS than any course or tutorial ever could. Here are some key takeaways that deepened my understanding of the AWS Cloud:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Availability Zones Matter for Storage&lt;/strong&gt;&lt;br&gt;
EBS volumes are tied to specific Availability Zones (AZs), which means they can't be directly attached across AZs. Creating and restoring snapshots is essential for moving data between zones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;S3 + EC2 in the Same Region = Zero Data Transfer Cost&lt;/strong&gt;&lt;br&gt;
Leveraging S3 for intermediate storage was not only reliable but also cost-effective. Data transfers between EC2 and S3 within the same region are completely free, making it perfect for large file movements.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Using Spot Instances for Cost Efficiency&lt;/strong&gt;&lt;br&gt;
Spot instances helped me stay well under budget while using powerful compute resources like &lt;code&gt;g5.2xlarge&lt;/code&gt; and even &lt;code&gt;t2.micro&lt;/code&gt; for setup tasks. It's a smart way to experiment with high-performance instances without burning cash.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open-Source Tools Can Outperform Official Options&lt;/strong&gt;&lt;br&gt;
Tools like &lt;code&gt;Legendary&lt;/code&gt; (a headless Epic Games CLI) enabled me to bypass bloated GUIs and install games quickly and efficiently—especially useful on low-resource instances.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AWS Cloud Enables Non-Traditional Use Cases&lt;/strong&gt;&lt;br&gt;
Running a high-end game like GTA V in the cloud isn’t just a tech flex—it proves that AWS can support demanding workloads creatively, as long as you understand the infrastructure limits and plan around them.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Final Thoughts
&lt;/h3&gt;

&lt;p&gt;This project was part cloud engineering, part gaming adventure. It pushed my understanding of EC2, storage, networking, and optimization far beyond the basics.&lt;/p&gt;

&lt;p&gt;If you're serious about learning cloud, do something fun and practical. You'll encounter real-world challenges—and solve them in creative ways.&lt;/p&gt;

&lt;p&gt;Now, if you’ll excuse me, I’ve got to explore Los Santos. On the cloud.&lt;/p&gt;

&lt;p&gt;Disclaimer: This blog post is intended for educational and research purposes only. All product names, logos, brands, and registered trademarks mentioned — including Grand Theft Auto V, Rockstar Games Launcher, Epic Games, and AWS — are the property of their respective owners. No affiliation or endorsement is implied.&lt;/p&gt;

&lt;p&gt;The game was legally obtained through a personal Epic Games account, and no part of this project involved unauthorized distribution or piracy. Running commercial software on cloud instances may violate the software's End User License Agreement (EULA). Readers are solely responsible for ensuring compliance with any relevant terms, policies, and conditions.&lt;/p&gt;

&lt;p&gt;The implementation shared here is a personal experiment meant to explore technical possibilities with cloud infrastructure. We do not encourage, promote, or take responsibility for any misuse of this information.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>cloud</category>
      <category>aws</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How I Connected My Home Network with AWS Regions Using Tailscale and VPC Peering</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Wed, 07 May 2025 15:57:56 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-i-connected-my-home-network-with-aws-regions-using-tailscale-and-vpc-peering-1n06</link>
      <guid>https://dev.to/dhairyashah/how-i-connected-my-home-network-with-aws-regions-using-tailscale-and-vpc-peering-1n06</guid>
      <description>&lt;p&gt;Hey there, fellow tech tinkerers! As a developer and cloud enthusiast, I love messing around in my home lab—a trusty Raspberry Pi 5 running my self-hosted setup. But sometimes, I need to tap into the power of AWS for testing, dev work, or hybrid projects. In this post, I’m spilling the beans on how I bridged my home network with &lt;strong&gt;two AWS regions (ap-south-1 and us-east-1)&lt;/strong&gt; using &lt;strong&gt;Tailscale&lt;/strong&gt;, &lt;strong&gt;EC2&lt;/strong&gt;, and &lt;strong&gt;VPC Peering&lt;/strong&gt;. The result? A secure, low-latency network that feels like magic. Let’s dive in!&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Why I Did This
&lt;/h3&gt;

&lt;p&gt;My home lab is my sandbox for coding, experimenting, and breaking things (gently). But when I need AWS’s managed services—like serverless functions or storage—I don’t want to deal with public IPs or clunky SSH setups. My goal was to create a &lt;strong&gt;private, secure, and dead-simple network bridge&lt;/strong&gt; connecting:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My &lt;strong&gt;Home Network (192.168.0.0/24)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;My &lt;strong&gt;AWS VPC in ap-south-1 (172.31.0.0/16)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;My &lt;strong&gt;AWS VPC in us-east-1 (172.15.0.0/16)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No public exposure, no VPN headaches—just smooth, encrypted access from my home terminal to the cloud.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ My Toolkit
&lt;/h3&gt;

&lt;p&gt;Here’s what I used to pull this off:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tailscale&lt;/strong&gt;: A slick, WireGuard-based mesh VPN that connects my devices and AWS instances like they’re on the same LAN.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon EC2&lt;/strong&gt;: A lightweight instance to relay traffic between my networks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;VPC Peering&lt;/strong&gt;: AWS’s way to privately link VPCs across regions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux Routing (&lt;code&gt;ip route&lt;/code&gt;, &lt;code&gt;sysctl&lt;/code&gt;)&lt;/strong&gt;: Good old Linux commands to handle custom routing.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔗 Step 1: Getting Tailscale Up and Running
&lt;/h3&gt;

&lt;p&gt;First things first, I installed Tailscale on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;My &lt;strong&gt;Raspberry Pi 5&lt;/strong&gt; (running Raspbian, because Debian is life) at home.&lt;/li&gt;
&lt;li&gt;A tiny &lt;strong&gt;EC2 instance&lt;/strong&gt; in my &lt;code&gt;ap-south-1&lt;/code&gt; VPC (172.31.0.0/16).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After signing both into my Tailscale account (super quick setup, by the way), I told the EC2 instance to advertise the VPC’s CIDR block so my home network could see it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tailscale up &lt;span class="nt"&gt;--advertise-routes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;172.31.0.0/16 &lt;span class="nt"&gt;--accept-routes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6f1pj8rb2kx9zx81nf2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq6f1pj8rb2kx9zx81nf2.png" alt="Screenshot of Tailscale subnet routes configuration showing advertised routes" width="800" height="145"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Boom! My home network could now reach private resources in &lt;code&gt;ap-south-1&lt;/code&gt; through Tailscale—no VPN, no bastion host, just pure simplicity.&lt;/p&gt;




&lt;h3&gt;
  
  
  🌍 Step 2: Routing VPC Traffic Back Home
&lt;/h3&gt;

&lt;p&gt;To let my home network talk to the &lt;code&gt;ap-south-1&lt;/code&gt; VPC, I turned on IP forwarding on the EC2 instance (because it’s gotta play traffic cop):&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;sudo &lt;/span&gt;sysctl &lt;span class="nt"&gt;-w&lt;/span&gt; net.ipv4.ip_forward&lt;span class="o"&gt;=&lt;/span&gt;1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, on my Raspberry Pi, I added a route to send VPC-bound traffic through the EC2’s Tailscale IP (mine was &lt;code&gt;100.104.53.61&lt;/code&gt;—yours will differ):&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;sudo &lt;/span&gt;ip route add 172.31.0.0/16 via 100.104.53.61
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgexh9nor2e140euj8stt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgexh9nor2e140euj8stt.png" alt="Screenshot of AWS EC2 instance with private IP address highlighted" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjbvuu1lvnnmpbtdbuga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnjbvuu1lvnnmpbtdbuga.png" alt="Terminal output showing successful ping to AWS private IP address" width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After this, I could &lt;code&gt;curl&lt;/code&gt; or ping internal VPC endpoints from my home lab. It felt like my Pi was living in the cloud!&lt;/p&gt;




&lt;h3&gt;
  
  
  🌐 Step 3: Hooking Up us-east-1 with VPC Peering
&lt;/h3&gt;

&lt;p&gt;Now, I wanted my &lt;code&gt;us-east-1&lt;/code&gt; VPC (172.15.0.0/16) to join the party. Enter &lt;strong&gt;VPC Peering&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Requester VPC&lt;/strong&gt;: &lt;code&gt;ap-south-1&lt;/code&gt; (172.31.0.0/16)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accepter VPC&lt;/strong&gt;: &lt;code&gt;us-east-1&lt;/code&gt; (172.15.0.0/16)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I set up the peering connection in the AWS console (pretty straightforward) and updated the route tables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ap-south-1 Route Table&lt;/strong&gt;: Added &lt;code&gt;172.15.0.0/16&lt;/code&gt; to route via the peering connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;us-east-1 Route Table&lt;/strong&gt;: Added &lt;code&gt;172.31.0.0/16&lt;/code&gt; to route via the peering connection.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qc9e1cqnvqs0swkpiwi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9qc9e1cqnvqs0swkpiwi.png" alt="AWS console screenshot showing route table configuration for ap-south-1 region" width="800" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lwkhvf44t9au1p0nubf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1lwkhvf44t9au1p0nubf.png" alt="AWS console screenshot showing VPC peering connection details" width="800" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This let my EC2 instance in &lt;code&gt;ap-south-1&lt;/code&gt; talk to &lt;code&gt;us-east-1&lt;/code&gt; resources. To make &lt;code&gt;us-east-1&lt;/code&gt; accessible from my home network, I updated the EC2’s Tailscale route advertisement to include both VPCs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;tailscale up &lt;span class="nt"&gt;--advertise-routes&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;172.31.0.0/16,172.15.0.0/16 &lt;span class="nt"&gt;--accept-routes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now my home lab could reach both AWS regions through the EC2 relay. Mind blown!&lt;/p&gt;




&lt;h3&gt;
  
  
  🔒 Locking It Down
&lt;/h3&gt;

&lt;p&gt;Security’s a big deal, so I made sure to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tighten Security Groups&lt;/strong&gt;: The EC2 instance only allows Tailscale traffic (UDP 41641, TCP 443) and internal VPC traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skip Public IPs&lt;/strong&gt;: No NAT gateways or Elastic IPs here—everything’s private and cost-effective.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use Tailscale ACLs&lt;/strong&gt;: I set up access controls in the Tailscale admin console to limit which devices can access which CIDRs. Only my trusted devices get through.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  ✅ What It All Looks Like
&lt;/h3&gt;

&lt;p&gt;Here’s the final network setup:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                            +-----------------------------+
                            |     Home Network (LAN)     |
                            |    CIDR: 192.168.0.0/24     |
                            |   Devices (Raspberry Pi,    |
                            |     Laptop, etc.)           |
                            +-------------+---------------+
                                          |
                                (Tailscale VPN Tunnel)
                                          |
                                          v
                  +----------------------------+
                  |     EC2 Relay Instance     |
                  |  Region: ap-south-1 (Mumbai)|
                  | Private IP: 172.31.x.x      |
                  +-------------+--------------+
                                |
     +--------------------------+---------------------------+
     |                                                      |
     v                                                      v
+------------------+                          +----------------------------+
| ap-south-1 VPC   |                          |  VPC Peering Connection     |
| CIDR: 172.31.0.0/16 |&amp;lt;---------------------&amp;gt;| us-east-1 VPC               |
| Internal Services |                         | CIDR: 172.15.0.0/16         |
| or Subnet A       |                         | Backend / Analytics         |
+------------------+                          +----------------------------+



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

&lt;/div&gt;



&lt;p&gt;It’s all private, encrypted, and surprisingly fast—no VPN appliances or public NAT nonsense.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9w9ws3gm3iisro5d635.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj9w9ws3gm3iisro5d635.png" alt="Network diagram showing the Tailscale connectivity between home network and AWS regions" width="800" height="1200"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🎯 Wrapping Up
&lt;/h3&gt;

&lt;p&gt;Setting this up has completely transformed my dev workflow. I can now access AWS resources from my home lab just like they’re part of my local network. Tailscale makes hybrid networking super smooth, and VPC Peering keeps traffic between regions fast and private.&lt;/p&gt;

&lt;p&gt;If you’re thinking about connecting your home lab to the cloud, I highly recommend giving this a shot—it’s secure, scalable, and honestly, kinda fun to build.&lt;/p&gt;

&lt;p&gt;Got questions or cool tips of your own? Let’s chat in the comments or feel free to reach out. Happy networking! 🚀&lt;/p&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@growtika?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Growtika&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-computer-generated-image-of-a-computer-WELyMatW3mw?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Getting Started with Rust: A Beginner’s Guide to Rust Programming</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Fri, 28 Jun 2024 17:07:37 +0000</pubDate>
      <link>https://dev.to/dhairyashah/getting-started-with-rust-a-beginners-guide-to-rust-programming-45o4</link>
      <guid>https://dev.to/dhairyashah/getting-started-with-rust-a-beginners-guide-to-rust-programming-45o4</guid>
      <description>&lt;h3&gt;
  
  
  Introduction
&lt;/h3&gt;

&lt;p&gt;Rust is a general-purpose programming language that emphasizes performance, type safety, and concurrency. It enforces memory safety, meaning that all references point to valid memory without a garbage collector.&lt;/p&gt;

&lt;p&gt;Rust was created as a personal project by Graydon Hoare while working at Mozilla Research in 2006. Today, Rust is adopted by many companies, including Amazon, Discord, Dropbox, Google, and Microsoft.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://stackoverflow.blog/2020/01/20/what-is-rust-and-why-is-it-so-popular/" rel="noopener noreferrer"&gt;Stack Overflow’s developer survey&lt;/a&gt;, 97% of the survey respondents have not used the Rust programming language. So, you will join the 3% who have worked with the Rust programming language.&lt;/p&gt;

&lt;p&gt;Let’s begin our Rust journey.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why Rust?
&lt;/h3&gt;

&lt;p&gt;Before learning Rust, you may wonder why you should learn the Rust programming language when there are similar languages like C and C++.&lt;/p&gt;

&lt;p&gt;Let’s explore why it has become a favored language among developers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Rust is as fast as C and C++, making it ideal for system-level programming.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory Safety:&lt;/strong&gt; Rust prevents null pointer dereferencing and buffer overflows through its ownership system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Concurrency:&lt;/strong&gt; Rust’s concurrency model ensures that data races are caught at compile-time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ecosystem and Tooling:&lt;/strong&gt; Cargo, Rust’s package manager and build system, simplifies dependency management and project configuration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Community:&lt;/strong&gt; Rust has a vibrant and welcoming community, with great documentation and support.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Linux or MacOS Installation
&lt;/h4&gt;

&lt;p&gt;To install the Rust programming language on your Linux or MacOS machine, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--proto&lt;/span&gt; &lt;span class="s1"&gt;'=https'&lt;/span&gt; &lt;span class="nt"&gt;--tlsv1&lt;/span&gt;.2 &lt;span class="nt"&gt;-sSf&lt;/span&gt; https://sh.rustup.rs | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation finishes, run the following commands to verify if Rust is installed properly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rustc &lt;span class="nt"&gt;--version&lt;/span&gt;
cargo &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you don’t have curl installed on your machine, run the following command:&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;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Windows Installation
&lt;/h4&gt;

&lt;p&gt;To install the Rust programming language on a Windows system, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First, go to the &lt;a href="https://www.rust-lang.org/tools/install" rel="noopener noreferrer"&gt;Rust official page&lt;/a&gt; and download the installer for Windows.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the installation finishes, run the following commands to check if Rust is installed properly:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;rustc &lt;span class="nt"&gt;--version&lt;/span&gt;
cargo &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Your First Rust Program: Hello World
&lt;/h3&gt;

&lt;p&gt;Let’s write the classic “Hello, World!” program to get a feel of Rust’s syntax and structure.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a new Rust project:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo new hello_world
&lt;span class="nb"&gt;cd &lt;/span&gt;hello_world
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the src directory and open &lt;code&gt;main.rs&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;src
vim main.rs
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Feel free to open the Rust project in your preferred IDE.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Edit &lt;code&gt;main.rs&lt;/code&gt; to print “Hello, World!”:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, World!"&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;/li&gt;
&lt;li&gt;
&lt;p&gt;Build and run the program:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This step does the job of both compilation and running, so you don’t need to compile the program manually every time you run it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Understanding the Code
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;fn main() { ... }&lt;/code&gt;: This defines the main function, which serves as the entry point of a Rust program.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;println!&lt;/code&gt;: It is a macro in Rust used for printing to the console.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, this was your first Rust program. How do you feel?&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Rust combines the performance and control of low-level languages with modern programming paradigms, making it a powerful tool for developers. From its unique ownership model to its robust ecosystem, Rust offers a rich programming experience.&lt;/p&gt;

&lt;p&gt;Here are a few important shell commands we have discussed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create a new project&lt;/strong&gt;: &lt;code&gt;cargo new project_name&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build a project&lt;/strong&gt;: &lt;code&gt;cargo build&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run a project&lt;/strong&gt;: &lt;code&gt;cargo run&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, this was it for this article. Stay tuned!&lt;/p&gt;

&lt;p&gt;Happy coding in Rust!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to set up your own proxy server in minutes?</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Sat, 27 Jan 2024 04:47:47 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-to-set-up-your-own-proxy-server-in-minutes-4ke</link>
      <guid>https://dev.to/dhairyashah/how-to-set-up-your-own-proxy-server-in-minutes-4ke</guid>
      <description>&lt;p&gt;Today, most websites track your online activities by capturing essential information such as IP addresses, cookies, and geolocation. All this information starts associating with the user, and a unique user profile is created over time. This helps the trackers to track the user’s activities over the internet, which in the end results in privacy concerns.&lt;/p&gt;

&lt;p&gt;Unlike third-party cookies, there is no straightforward way to opt out of this kind of tracking.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;What is a Proxy Server?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;1.1 Benefits of using a Proxy Server&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;So, how to make our proxy server?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;2.1 Prerequisites&lt;/p&gt;

&lt;p&gt;2.2 Create an Ubuntu Server&lt;/p&gt;

&lt;p&gt;2.3 Configuring the Server&lt;/p&gt;

&lt;p&gt;2.4 Setting up the proxy locally&lt;/p&gt;

&lt;p&gt;2.5 Testing the proxy server&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  What is a Proxy Server?
&lt;/h2&gt;

&lt;p&gt;A proxy server is an intermediate server that acts as a gateway between the user’s device and the internet. When a user makes a request for a resource, let’s say a website, the request is first sent to the proxy server. The proxy server then forwards the request to the website’s server on behalf of the user. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbveood3693o9dnkjn71c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbveood3693o9dnkjn71c.png" alt="Untitled" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Benefits of using a Proxy Server
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Privacy Protection:&lt;/strong&gt; Proxy servers can be used to protect the user’s privacy. They are used to hide the user’s actual IP address from the websites they visit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Performance:&lt;/strong&gt; Proxy servers can be used to cache the requests that are frequently accessed. This helps in faster response and reduces the bandwidth usage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimal Performance:&lt;/strong&gt; In a server having large traffic (requests), proxy servers can be used for load balancing. Requests from the users are distributed across multiple servers to provide optimal performance and prevent the single server from being overloaded by the huge traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Security:&lt;/strong&gt; As we discussed earlier, the proxy server provides an additional layer of security by acting as the middleman between the user’s device and the internet. They can filter out the malicious content and block certain types of attacks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Proxy servers can be operated at different OSI models, including the HTTP proxies, transport proxies (SOCKS proxies), or even the lower layers.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, how to make our proxy server?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Any cloud service provider account. (DigitalOcean Recommended)&lt;/li&gt;
&lt;li&gt;One Ubuntu 20.04 or later server, with at least 512MB of RAM.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Create an Ubuntu Server
&lt;/h3&gt;

&lt;p&gt;In this tutorial, I will be using DigitalOcean to host my VPS.&lt;/p&gt;

&lt;p&gt;Create an account on DigitalOcean, if you haven’t done so yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://m.do.co/c/59c3a25113a5" rel="noopener noreferrer"&gt;Use my referral link to create an account on DigitalOcean&lt;/a&gt; to get $200 worth of credits for 60 days.&lt;/p&gt;

&lt;p&gt;Now create a new project. &lt;/p&gt;

&lt;p&gt;In the sidebar click &lt;strong&gt;New Project&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftib63dwjjd1lqbdshvn0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftib63dwjjd1lqbdshvn0.jpg" alt="Create New Project" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enter a name, for example, “&lt;strong&gt;Proxy Server”&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Choose something in the “Tell us what it’s for” box, or you can’t create the project. Then click &lt;strong&gt;Create Project&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the next page, click “Skip for now”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qez3cj8xja7sv56418d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0qez3cj8xja7sv56418d.jpg" alt="Skip for now" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project has now been created.&lt;/p&gt;

&lt;p&gt;Now, click on &lt;strong&gt;Spin up a Droplet&lt;/strong&gt; to create a VPS (Virtual Private Server).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhppotu1uqh1sac852raf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhppotu1uqh1sac852raf.jpg" alt="Spin up a droplet" width="800" height="585"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows the interface for creating a new droplet.&lt;/p&gt;

&lt;p&gt;Choose a region where you want your internet activity to be routed through the proxy.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbmhoqnm5x11yeo981sq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbmhoqnm5x11yeo981sq.jpg" alt="Choose a region" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To initiate the installation of Ubuntu on your Droplet, simply pick the Ubuntu option from the 'Choose an image' section.&lt;/p&gt;

&lt;p&gt;Now, choose the droplet size. The default selection is the 'Premium Intel/AMD' CPUs, but for our current needs, we don't require that level of power. Instead, opt for the 'Regular' CPU option, which comes with a $4 per month plan. Note that in certain regions, the $4 per month plan may not be accessible, so in such cases, pick the most economical plan offered in that region.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqm70wvja8fwrkhpxlmk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flqm70wvja8fwrkhpxlmk.jpg" alt="Choose the droplet size" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now go down below, and set up a strong root user password.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd39jmzxtluey1588wcn5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd39jmzxtluey1588wcn5.jpg" alt="Create strong root password" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Finally, create the &lt;strong&gt;Droplet&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It may take some time to boot the server. Once the server starts running, copy the IPv4 address.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhfic92biqykn1h8urty.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhfic92biqykn1h8urty.jpg" alt="Copy to ipv4 address" width="800" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we have successfully configured our server setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring the Server
&lt;/h3&gt;

&lt;p&gt;Open the terminal, and login to your Ubuntu server using &lt;code&gt;openssh&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh root@YOUR_SERVER_IPV4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you log into your Ubuntu server. Install &lt;code&gt;openssh-server&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;openssh-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you have finished installing, log out from the server.&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;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Setting up the proxy locally
&lt;/h3&gt;

&lt;p&gt;On your local machine, open the terminal and run the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-D&lt;/span&gt; 2402 &lt;span class="nt"&gt;-N&lt;/span&gt;  &lt;span class="nt"&gt;-C&lt;/span&gt; root@YOUR_SERVER_IPV4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now open the Firefox browser, and open the settings. In settings, search for the “Proxy”. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy038118zib3n3r2mufvz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy038118zib3n3r2mufvz.jpg" alt="Firefox &amp;gt; settings&amp;gt; proxy" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now click on the “Settings”,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F503iknpnqpvnvq4akylt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F503iknpnqpvnvq4akylt.jpg" alt="Manual Proxy Configuration" width="800" height="957"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Choose, the “Manual Proxy Configuration”, and enter the details in the &lt;strong&gt;SOCKS Host&lt;/strong&gt; input field as shown in the above image.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;localhost&lt;/code&gt; | &lt;code&gt;PORT: 2402&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now click on OK, and you have successfully configured the proxy.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing the proxy server
&lt;/h3&gt;

&lt;p&gt;Before connecting to the proxy server:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fduhij0ii7r1y4dzx2ixz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fduhij0ii7r1y4dzx2ixz.jpg" alt="Before connecting to proxy server" width="800" height="152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After connecting to the proxy server:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6atfd2mxltd6bpwu8ws.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff6atfd2mxltd6bpwu8ws.jpg" alt="After connecting to proxy server" width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;So, this is how we can set up a proxy server on our own, and protect our privacy, and maintain anonymity online.&lt;/p&gt;

&lt;p&gt;I hope this article, was helpful to you. Thanks for reading!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/dhairyashah_dev/" rel="noopener noreferrer"&gt;Follow me on X&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Originally published on &lt;a href="https://www.dhairyashah.dev/posts/how-to-build-a-rest-api-with-hono-in-5-minutes/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@scottrodgerson?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Scott Rodgerson&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-bunch-of-blue-wires-connected-to-each-other-PSpf_XgOM5w?utm_content=creditCopyText&amp;amp;utm_medium=referral&amp;amp;utm_source=unsplash" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>cloud</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to build a REST API with Hono in 5 Minutes?</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Fri, 26 Jan 2024 10:51:03 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-to-build-a-rest-api-with-hono-in-5-minutes-4ng6</link>
      <guid>https://dev.to/dhairyashah/how-to-build-a-rest-api-with-hono-in-5-minutes-4ng6</guid>
      <description>&lt;p&gt;Today, the &lt;strong&gt;REST APIs&lt;/strong&gt; have become the backbone of modern applications, enabling the seamless connection between the front end and the back end. There are lots of technologies and methods available in the market to build a REST API. In this article, we are going to learn about the &lt;a href="https://hono.dev/" rel="noopener noreferrer"&gt;Hono&lt;/a&gt; which is a fast, simple, and lightweight web framework that runs on Edge.&lt;/p&gt;

&lt;p&gt;If you are unfamiliar with the REST APIs, then let me share about them in brief.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is a REST API?
&lt;/h3&gt;

&lt;p&gt;Imagine you’re at a restaurant, and you want to order some food. You don’t go into the kitchen and cook yourself; instead, you ask the waiter to bring you the dishes you want.&lt;/p&gt;

&lt;p&gt;Similarly, in the world of computer networks, REST (Representational State Transfer) is like a waiter, and APIs (Application Programming Interfaces) are like a menu. So, REST API is a set of rules that lets different software applications communicate with each over across the internet (or network).&lt;/p&gt;

&lt;p&gt;Here is a popular meme about REST APIs,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00dm7ndobu0t5nbz1rh6.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F00dm7ndobu0t5nbz1rh6.jpeg" alt="API MEME" width="800" height="782"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As always, our first step is to create an application. In our case, it's an Hono web application, to create run the following command:&lt;/p&gt;

&lt;h3&gt;
  
  
  Let’s Begin with Hono 🔥
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm create hono@latest hono-tutorial
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you will see a bunch of template choices you would like to use. Let’s select &lt;strong&gt;Cloudflare Workers&lt;/strong&gt;, for this tutorial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;? Which template &lt;span class="k"&gt;do &lt;/span&gt;you want to use?
    aws-lambda
    bun
    cloudflare-pages
❯   cloudflare-workers
    deno
    fastly
    lagon
    nextjs
    nodejs
    vercel
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Hono application is created inside &lt;code&gt;hono-tutorial&lt;/code&gt; folder. So open the folder in the terminal and install the required dependencies.&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;cd &lt;/span&gt;hono-tutorial
npm i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the installation, you can open the project in your favourite IDE.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating the API Routes
&lt;/h3&gt;

&lt;p&gt;Open &lt;code&gt;src/index.ts&lt;/code&gt;, and there will be a boilerplate code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;import &lt;span class="o"&gt;{&lt;/span&gt; Hono &lt;span class="o"&gt;}&lt;/span&gt; from &lt;span class="s1"&gt;'hono'&lt;/span&gt;

const app &lt;span class="o"&gt;=&lt;/span&gt; new Hono&lt;span class="o"&gt;()&lt;/span&gt;

app.get&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/'&lt;/span&gt;, &lt;span class="o"&gt;(&lt;/span&gt;c&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;c.text&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Hello Hono!'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="o"&gt;})&lt;/span&gt;

&lt;span class="nb"&gt;export &lt;/span&gt;default app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Hono, a route can be defined in the following manner:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibwe8ximx797ih3vcp4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fibwe8ximx797ih3vcp4z.png" alt="API Route Defining rule" width="504" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create your first API route:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside, &lt;code&gt;src/index.ts&lt;/code&gt; write the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&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="s2"&gt;/name&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;c&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is Dhairya!&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="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, run the Hono application by running the following command in the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open the application in the Postman / Insomnia. In this tutorial, I will be using Insomnia.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F66848847-6d9d-44c0-96be-3b7220096ccf%2F2c65bdc1-8cd4-4cca-9151-cd03968e1c8a%2FScreenshot_2024-01-26_at_3.36.41_PM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F66848847-6d9d-44c0-96be-3b7220096ccf%2F2c65bdc1-8cd4-4cca-9151-cd03968e1c8a%2FScreenshot_2024-01-26_at_3.36.41_PM.png" alt="Screenshot 2024-01-26 at 3.36.41 PM.png" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is Dhairya!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tada! You've successfully developed your REST API using Hono; wasn't that simple?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating the POST Route:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Similar to the GET method, we can create a POST method API route following the same manner. Here’s how to do that:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/sports&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;c&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="nf"&gt;parseBody&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;sports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sports&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;country&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`I love &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sports&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;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this code, &lt;code&gt;body["sports"]&lt;/code&gt; returns the key value of “sports” passed in the form body.&lt;/p&gt;

&lt;p&gt;Here’s the curl request for the &lt;code&gt;/sports&lt;/code&gt; API route:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;--request&lt;/span&gt; POST &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--url&lt;/span&gt; http://localhost:8787/sports &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--header&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type: application/x-www-form-urlencoded'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--data&lt;/span&gt; &lt;span class="nv"&gt;sports&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Cricket
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After calling this api route, the output will look like following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;country&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I love Cricket!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similarly, you can create API routes for the different methods i.e. PUT, PATCH, DELETE, OPTIONS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;Congratulations! You've successfully learned how to build a REST API using Hono in just a few minutes. Here's a quick recap of the key steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Complete Source Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&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="s2"&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;c&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello Hono!&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;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/name&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;c&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;My name is Dhairya!&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="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;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/sports&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;c&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="nf"&gt;parseBody&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;sports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sports&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;country&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`I love &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;sports&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;span class="p"&gt;});&lt;/span&gt;

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

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With these simple steps, you've successfully built a REST API with Hono. Feel free to explore additional features and customization options offered by Hono for more advanced use cases. Happy coding!&lt;/p&gt;

&lt;p&gt;For your further reference, you can check out official &lt;a href="https://hono.dev/top" rel="noopener noreferrer"&gt;Hono Docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading! &lt;a href="https://twitter.com/dhairyashah_dev" rel="noopener noreferrer"&gt;Follow me on X&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>tutorial</category>
      <category>programming</category>
      <category>api</category>
    </item>
    <item>
      <title>How to create a confetti effect in HTML?</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Fri, 16 Jun 2023 16:42:18 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-to-create-a-confetti-effect-in-html-41m2</link>
      <guid>https://dev.to/dhairyashah/how-to-create-a-confetti-effect-in-html-41m2</guid>
      <description>&lt;p&gt;Adding a confetti effect to a website can bring an element of celebration and joy to various interactions. This article will explore how to create a confetti effect in HTML using the famous library, &lt;a href="https://www.npmjs.com/package/canvas-confetti" rel="noopener noreferrer"&gt;Canvas Confetti,&lt;/a&gt; which allows you to generate colorful and animated confetti particles on a web page.&lt;/p&gt;

&lt;p&gt;There are lots of ways you can add confetti to your website. But, in this article, I will share a super simple method to add it to your website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up HTML
&lt;/h3&gt;

&lt;p&gt;Inside your HTML file, we need to link a javascript file to it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"module"&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"confetti.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Please ensure that you include &lt;code&gt;type="module"&lt;/code&gt; in the script tag; otherwise, the JavaScript code may not function as intended.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"btn"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Click me&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have created a button to pop confetti upon clicking the button.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating confetti
&lt;/h3&gt;

&lt;p&gt;We’ll be using Canvas Confetti using &lt;a href="https://www.skypack.dev/" rel="noopener noreferrer"&gt;Skypack&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Inside your javascript file, add the following code to import the required package to our webpage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;confetti&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://cdn.skypack.dev/canvas-confetti&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once finished importing, create a function to initialize the confetti from the imported package,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;makeConfetti&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="nf"&gt;confetti&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;Now after creating the function we’ll call it,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;btn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;btn&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;btn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;click&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;makeConfetti&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tada! You have successfully popped confetti in HTML in just two lines of code.&lt;/p&gt;

&lt;p&gt;Source code: &lt;a href="https://github.com/dhairyathedev/confetti-tutorial" rel="noopener noreferrer"&gt;https://github.com/dhairyathedev/confetti-tutorial&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope you have learned something new from this article. Thanks a lot for reading till the end, have a great day!&lt;/p&gt;

&lt;p&gt;Credits: Banner Image - Photo by &lt;a href="https://unsplash.com/@dendrolago89?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Damiano Lingauri&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/uW_oj3jOPRg?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>programming</category>
    </item>
    <item>
      <title>Introducing QRInked - Create and Manage QR Codes</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Mon, 22 May 2023 16:22:41 +0000</pubDate>
      <link>https://dev.to/dhairyashah/introducing-qrinked-create-and-manage-qr-codes-2hlg</link>
      <guid>https://dev.to/dhairyashah/introducing-qrinked-create-and-manage-qr-codes-2hlg</guid>
      <description>&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I created a web-based application called &lt;a href="https://qrinked.dhairyashah.dev/" rel="noopener noreferrer"&gt;QRInked&lt;/a&gt; that allows users to create and manage QR codes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Category Submission:
&lt;/h3&gt;

&lt;p&gt;The best category matches my project is &lt;strong&gt;Wacky Wildcards&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  App Link
&lt;/h3&gt;

&lt;p&gt;Here's link to my submission - &lt;a href="https://qrinked.dhairyashah.dev/" rel="noopener noreferrer"&gt;https://qrinked.dhairyashah.dev/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Screenshots
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52yut2kk4lekorkhxgov.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52yut2kk4lekorkhxgov.png" alt="QRInked Landing" width="800" height="656"&gt;&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/hJTBLW39FKQ"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Description
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;QRInked&lt;/strong&gt; is a simple and easy-to-use tool that helps you create and manage QR codes. With QRInked, you can create QR codes for any links, images and many more.&lt;/p&gt;

&lt;p&gt;QRInked allows you to create following types of QRs for you and your business:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Website&lt;/li&gt;
&lt;li&gt;WIFI&lt;/li&gt;
&lt;li&gt;Call&lt;/li&gt;
&lt;li&gt;SMS&lt;/li&gt;
&lt;li&gt;YouTube&lt;/li&gt;
&lt;li&gt;Instagram&lt;/li&gt;
&lt;li&gt;Whatsapp&lt;/li&gt;
&lt;li&gt;and many more coming...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Created QR codes can be saved online and can be accessed from any device. All QRs are synced on the cloud.&lt;/p&gt;

&lt;p&gt;Currently, QR codes can be downloaded in two formats &lt;strong&gt;JPG and PNG&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;It is fun to create QR codes here, why not give it a try?&lt;/p&gt;

&lt;h3&gt;
  
  
  Link to Source Code
&lt;/h3&gt;

&lt;p&gt;Source Code link to GitHub - &lt;a href="https://github.com/dhairyathedev/qrinked/" rel="noopener noreferrer"&gt;https://github.com/dhairyathedev/qrinked/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Permissive License
&lt;/h3&gt;

&lt;p&gt;This project is under &lt;a href="https://github.com/dhairyathedev/qrinked/blob/main/LICENSE" rel="noopener noreferrer"&gt;MIT License&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Background (What made you decide to build this particular app? What inspired you?)
&lt;/h2&gt;

&lt;p&gt;With the rapid growth of online startups and businesses, an effective approach to capturing users' attention is through the utilization of QR codes. By simply capturing an image of a QR code, users can be directed to the desired destination. This inspired me to conceive an online application that enables the creation and management of QR codes, facilitating businesses in running successful marketing campaigns and attracting users. Hence introducing QRInked, the solution to this challenge.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I built it (How did you utilize GitHub Actions or GitHub Codespaces? Did you learn something new along the way? Pick up a new skill?)
&lt;/h3&gt;

&lt;p&gt;QRInked was developed by leveraging Next.js in conjunction with GitHub Codespaces and GitHub Actions.&lt;/p&gt;

&lt;p&gt;Here's my tech-stack:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js&lt;/li&gt;
&lt;li&gt;Supabase&lt;/li&gt;
&lt;li&gt;Tailwind CSS&lt;/li&gt;
&lt;li&gt;GitHub&lt;/li&gt;
&lt;li&gt;Figma&lt;/li&gt;
&lt;li&gt;shadcn/ui&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The utilization of GitHub Codespaces enabled me to efficiently and effortlessly create my project by providing a virtual development environment.&lt;/p&gt;

&lt;p&gt;Additionally, GitHub Actions played a crucial role in automating various tasks for me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources/Info
&lt;/h3&gt;

&lt;p&gt;We welcome any suggestions or updates you may have for QRInked. Please feel free to contribute as it is an entirely open-source project.&lt;/p&gt;

</description>
      <category>githubhack23</category>
      <category>react</category>
      <category>javascript</category>
      <category>github</category>
    </item>
    <item>
      <title>What is a slug and how to create one?</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Mon, 08 May 2023 14:13:28 +0000</pubDate>
      <link>https://dev.to/dhairyashah/what-is-a-slug-and-how-to-create-one-j9f</link>
      <guid>https://dev.to/dhairyashah/what-is-a-slug-and-how-to-create-one-j9f</guid>
      <description>&lt;p&gt;&lt;strong&gt;A slug is a piece of text that is attached to the end of a URL (after the backslash "/")&lt;/strong&gt; that is unique and locates the specific page of a website.&lt;/p&gt;

&lt;p&gt;The use of a slug can provide dual benefits for a website. Firstly, it can improve the website's SEO performance. Secondly, it helps visitors to confirm that they have arrived at the correct website they were searching for.&lt;/p&gt;

&lt;p&gt;Mainly, slugs can be classified into two major categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Randomly generated slug&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;and a meaningful slug&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the following example showing the difference between and randomly generated slug and a meaningful slug:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;https://example.com/5p2pd1mj6f &lt;span class="c"&gt;# Random&lt;/span&gt;

https://example.com/how-to-feed-a-dog &lt;span class="c"&gt;# Meaningful&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Seeing the above example, you can clearly tell the difference that the second example (from the top) is much better to understand than the first one.&lt;/p&gt;

&lt;p&gt;As mentioned earlier, the slugs play a very important role in the SEO score of a website; the meaningful slug provides a good impression to the crawlers and helps rank better on SERP (Search Engine Result Page). When compared to meaningful slugs, the usage of random slugs can create a negative impression on crawlers. Consequently, such slugs are considered spam or may not receive a ranking on the search engine results page (SERP).&lt;/p&gt;

&lt;p&gt;Therefore, it’s important to know why slugs are relevant and how to optimize them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why is a good URL slug important for SEO?
&lt;/h3&gt;

&lt;p&gt;Have you ever tried to copy a URL with a long stream of a string of randomly generated strings containing symbols, letters, and numbers?&lt;/p&gt;

&lt;p&gt;Not only is it irritating to look at in your search bar, but it looks untrustworthy and might prevent you from sharing or linking to that URL.&lt;/p&gt;

&lt;p&gt;Now you can imagine the SERP having the same stream of nonsense.&lt;/p&gt;

&lt;p&gt;For search engine algorithms to accurately comprehend the data they encounter, it is essential to have unambiguous, streamlined, and optimized content.&lt;/p&gt;

&lt;p&gt;By incorporating a concise, lucid, and well-structured URL slug, you can facilitate better comprehension of your web pages by both visitors and search engines. Moreover, your URL slug can also serve as an unexplored source of potential for keyword ranking.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to create the best URL slugs
&lt;/h3&gt;

&lt;p&gt;Now that we understand the importance of a good URL slug, let's take a look at the best practices to be kept in mind for slug creation.&lt;/p&gt;

&lt;p&gt;The following are the best practices for the best URL slug creation:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Keep your slugs short&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use the "-" symbol&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Match the slugs to headlines&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use lowercase letters&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Avoid adding dates/years to the slug&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Manually creating slugs while keeping all these best practices in mind can be a bit frustrating and time-consuming job.&lt;/p&gt;

&lt;p&gt;As a result, the following are the few tools that help to create slugs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://slugify.online/" rel="noopener noreferrer"&gt;https://slugify.online/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.webslesson.info/p/online-slug-generator-tool.html" rel="noopener noreferrer"&gt;https://www.webslesson.info/p/online-slug-generator-tool.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://appdevtools.com/slug-generator" rel="noopener noreferrer"&gt;https://appdevtools.com/slug-generator&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are a terminal lover, there's also a CLI tool for generating slugs from a string:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisite - (Node.js should have been installed on your machine)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx slugdog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read the docs on &lt;a href="http://npmjs.com/slugdog" rel="noopener noreferrer"&gt;NPM.js - http://npmjs.com/slugdog&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I use this CLI tool to create slugs for my blog posts.&lt;/p&gt;

&lt;p&gt;And you are good to go...&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In conclusion, incorporating a well-optimized and meaningful URL slug can bring numerous benefits to a website, including improved SEO performance, better user experience, and the potential for higher keyword rankings. I&lt;/p&gt;

&lt;p&gt;t is crucial to avoid using randomly generated slugs, which can have negative consequences on search engine rankings and may be perceived as spam.&lt;/p&gt;

&lt;p&gt;By following the best practices for slug creation, such as keeping slugs short, using the "-" symbol, matching slugs to headlines, and avoiding adding dates/years to the slug, website owners can create better URL structures for their pages. Additionally, there are several online tools available to generate slugs automatically, making the process less time-consuming and more efficient.&lt;/p&gt;

&lt;p&gt;Cover Photo by &lt;a href="https://unsplash.com/@nathanareboucas?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Nathana Rebouças&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/c4aT8MfEzdw?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>seo</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Best Ways to Check if a Value is a Number in JavaScript</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Tue, 28 Mar 2023 08:11:21 +0000</pubDate>
      <link>https://dev.to/dhairyashah/the-best-ways-to-check-if-a-value-is-a-number-in-javascript-51ml</link>
      <guid>https://dev.to/dhairyashah/the-best-ways-to-check-if-a-value-is-a-number-in-javascript-51ml</guid>
      <description>&lt;p&gt;JavaScript developers often need to check whether a value is a number or not. There are several methods in JavaScript that can help determine if a variable is a number or not.&lt;/p&gt;

&lt;p&gt;In this article, we will discuss the best ways to check if a value is a number in JavaScript, including the &lt;code&gt;isNaN()&lt;/code&gt; method, the &lt;code&gt;typeof&lt;/code&gt; operator, and the &lt;code&gt;Number.isInteger()&lt;/code&gt; method. By the end of this article, you will have a clear understanding of how to identify numbers in JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. isNaN()
&lt;/h3&gt;

&lt;p&gt;The first method, we are going to use is &lt;code&gt;isNaN()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The method &lt;code&gt;isNaN()&lt;/code&gt; stands for &lt;strong&gt;"is-not-a-number"&lt;/strong&gt;. If a number is passed as a parameter to it, the method will return false.&lt;/p&gt;

&lt;p&gt;Here are a few examples with comments describing the output of the &lt;code&gt;isNaN()&lt;/code&gt; method.&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;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&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;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;

&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;({})&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;span class="nf"&gt;isNaN&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. "typeof" Operator
&lt;/h3&gt;

&lt;p&gt;Another way to determine if the input is a number is to use the &lt;code&gt;typeof&lt;/code&gt; operator.&lt;/p&gt;

&lt;p&gt;It returns &lt;code&gt;number&lt;/code&gt; string when you use it on a number.&lt;/p&gt;

&lt;p&gt;For example,&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;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 'number'&lt;/span&gt;

&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 'number'&lt;/span&gt;

&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;//  'string'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, you can apply a conditional check to this,&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;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;number&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
    &lt;span class="c1"&gt;// Logic goes here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// X is not a number&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Number.isInteger()
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;Number.isInteger()&lt;/code&gt; method returns &lt;code&gt;true&lt;/code&gt; if an integer value is passed as a parameter.&lt;/p&gt;

&lt;p&gt;Otherwise, it returns &lt;code&gt;false&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; that Number.isInteger() is only applicable for integer data types. It will accurately return true for 4 but will return false for non-integer values like 3.14. You should only use this method if you specifically need to validate integer data types.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isInteger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isInteger&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In conclusion, JavaScript offers several ways to determine if a variable is a number or not. The &lt;code&gt;isNaN()&lt;/code&gt; method checks if a value is not a number, the &lt;code&gt;typeof&lt;/code&gt; operator can be used to check if a value is a number, and the &lt;code&gt;Number.isInteger()&lt;/code&gt; method can be used to validate integer data types specific. It is important to choose the appropriate method based on the specific needs of the program.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to get the current date time of other countries in JavaScript</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Mon, 06 Mar 2023 12:43:52 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-to-get-the-current-date-time-of-other-countries-in-javascript-hpb</link>
      <guid>https://dev.to/dhairyashah/how-to-get-the-current-date-time-of-other-countries-in-javascript-hpb</guid>
      <description>&lt;p&gt;In our interconnected world, being aware of the date and time in other countries is crucial. Luckily, Javascript offers a simple solution for accessing this information. In this article, we'll demonstrate how to use Javascript to obtain the current date and time in other countries.&lt;/p&gt;

&lt;p&gt;In this article, I will be using the USA as an example. So, let's get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step: 1 Create a new date object
&lt;/h3&gt;

&lt;p&gt;The first step is to create a new Date Object. This new date object will represent the current date and time of your local timezone.&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;d&lt;/span&gt; &lt;span class="o"&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step: 2 Get local time and offset
&lt;/h3&gt;

&lt;p&gt;Next, we need to get the local time and offset of the current date and time in the local timezone.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is the local time in Javascript?
&lt;/h4&gt;

&lt;p&gt;The local time is the number of milliseconds since 1st January 1970 (UTC). The offset is the difference between the local time and UTC time.&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;localTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTime&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;localOffset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTimezoneOffset&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Calculate the UTC time
&lt;/h3&gt;

&lt;p&gt;Now, we need to calculate the UTC time by adding the local time and the time offset.&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;utc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localTime&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;localOffset&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step: 4 Calculate the time for the country
&lt;/h3&gt;

&lt;p&gt;Now, we can calculate the time for the country by adding the UTC time and the offset together.&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;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// UTC of USA Eastern Time Zone is -05.00&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;utc&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3600000&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Make sure to change the country offset as per your requirement.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step: 5 Get the current date and time for the USA
&lt;/h3&gt;

&lt;p&gt;Finally, we can use the new Date() and toLocaleString() methods to get the current date and time for the USA in a human-readable format.&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;usaTimeNow&lt;/span&gt; &lt;span class="o"&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="nx"&gt;usa&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here's the complete code to get the current date and time of any country in Javascript:&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;d&lt;/span&gt; &lt;span class="o"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;localTime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTime&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;localOffset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getTimezoneOffset&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60000&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;utc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localTime&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;localOffset&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;offset&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// UTC of USA Eastern Time Zone is -05.00&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usa&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;utc&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3600000&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;offset&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;usaTimeNow&lt;/span&gt; &lt;span class="o"&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="nx"&gt;usa&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toLocaleString&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="nx"&gt;usaTimeNow&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;To sum up, you can easily obtain the date and time of any country by solely utilizing Javascript, without relying on external software or APIs.&lt;/p&gt;

&lt;p&gt;I hope this article was helpful to you! Thank you for reading.&lt;/p&gt;

&lt;p&gt;Cover Image Source: Unsplash&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Hide JavaScript Code in View Source</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Sat, 04 Mar 2023 11:56:58 +0000</pubDate>
      <link>https://dev.to/dhairyashah/how-to-hide-javascript-code-in-view-source-39kg</link>
      <guid>https://dev.to/dhairyashah/how-to-hide-javascript-code-in-view-source-39kg</guid>
      <description>&lt;p&gt;In practice, it is impossible to hide the Javascript code from the source code, because the Javascript code is downloaded to the client browser in clear text and is executed completed by the browser.&lt;/p&gt;

&lt;p&gt;As a result in this article, I will share with you a few methods to hinder and make it difficult to read the javascript source code:&lt;/p&gt;

&lt;h3&gt;
  
  
  Obfuscate the javascript code
&lt;/h3&gt;

&lt;p&gt;Obfuscation is a technique that changes the code structure to make it harder to understand. For example, variable names can be replaced with random characters or strings. This makes the code harder to read and understand, as said earlier it doesn't provide complete protection.&lt;/p&gt;

&lt;p&gt;There are tools available online to obfuscate the javascript code, such as &lt;a href="https://www.obfuscator.io/" rel="noopener noreferrer"&gt;JavaScript Obfuscator Tool&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9y77mmg8i4aq5ii93c2q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9y77mmg8i4aq5ii93c2q.jpg" alt="JS-Obfuscate" width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Server Side Rendering
&lt;/h3&gt;

&lt;p&gt;To maintain the security and privacy of sensitive code, it is important to execute computations on the server side rather than the client side. This approach is commonly used in various web applications, particularly those that handle confidential data such as online banking applications. By performing the computations on the server side, the sensitive code is kept hidden from the client side, thus reducing the risk of unauthorized access, tampering, or theft.&lt;/p&gt;

&lt;p&gt;In executing computations on the server side, the web application works by sending a request from the client side to the server side, which then processes the request and sends the result back to the client side. This approach ensures that the sensitive code is never exposed to the client side, which may be vulnerable to hacking or other security breaches.&lt;/p&gt;

&lt;p&gt;Moreover, the server-side processing of computations offers several benefits, such as faster performance, enhanced scalability, and efficient use of resources. Since the server side can handle multiple requests simultaneously, it can provide faster response times and a better user experience. Additionally, the server-side can efficiently manage the computational resources, ensuring that the application can handle large volumes of data and users without compromising performance.&lt;/p&gt;

&lt;p&gt;Taking note of all these benefits, developers need to consider the server-side approach when building web applications that handle confidential data.&lt;/p&gt;
&lt;h3&gt;
  
  
  Javascript minification
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyypnvu759n5pqp0eplcz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyypnvu759n5pqp0eplcz.jpg" alt="JS-minify" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Minification is a process that involves optimizing the code by removing unnecessary characters such as white spaces, and comments, and shortening variable names. It is a technique that is commonly used to reduce the amount of data that needs to be sent over the internet, which in turn speeds up the loading time of web pages.&lt;/p&gt;

&lt;p&gt;During the minification process, the code is stripped of all extraneous characters to make it as compact as possible. This is achieved by removing all spaces, tabs, and line breaks from the code. Additionally, all comments are removed from the code, as well as any code that is not necessary for the functioning of the program.&lt;/p&gt;

&lt;p&gt;Although minification makes the code smaller and harder to read, it is still possible to understand the code if someone is determined to do so. However, the primary objective of minification is to optimize the code and reduce the amount of data that needs to be transmitted. This, in turn, helps to speed up the loading time of web pages, resulting in a better user experience for website visitors.&lt;/p&gt;
&lt;h3&gt;
  
  
  Disabling the right mouse click
&lt;/h3&gt;

&lt;p&gt;One method to prevent users from accessing the context menu, which includes options such as viewing source, inspecting elements, and saving images, is by disabling right-clicking through event listeners or CSS properties. However, this approach is not entirely effective in hiding code, as users can still access the source code using keyboard shortcuts or browser tools.&lt;/p&gt;

&lt;p&gt;Here's how to disable the right mouse click in javascript,&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="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;contextmenu&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;preventDefault&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: You should not disable the right click as it makes the website less accessible resulting bad User Experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In conclusion, while it is impossible to completely hide Javascript code from the source code, several methods can be used to make it more difficult to read and understand. Obfuscation, server-side rendering, Javascript minification, and disabling the right mouse click are some of the techniques that can be used to protect sensitive code.&lt;/p&gt;

&lt;p&gt;However, it is important to note that these methods are not foolproof and determined individuals can still access the code if they are motivated enough. Therefore, developers must implement multiple layers of security to protect their code and ensure the safety of their web applications.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>5 Steps to Become a React Pro in 2023!</title>
      <dc:creator>Dhairya Shah</dc:creator>
      <pubDate>Sun, 08 Jan 2023 06:40:12 +0000</pubDate>
      <link>https://dev.to/dhairyashah/5-steps-to-become-a-react-pro-in-2023-52ee</link>
      <guid>https://dev.to/dhairyashah/5-steps-to-become-a-react-pro-in-2023-52ee</guid>
      <description>&lt;p&gt;It's 2023, and the demand for skilled front-end developers is higher than ever. One of the most sought-after skills in the industry is proficiency in React, the popular JavaScript library for building user interfaces. &lt;/p&gt;

&lt;p&gt;If you want to join the ranks of the React professionals and take your career to the next level, it's time to start learning. But where do you begin? Don't worry, I've got you covered. In this article, I will provide a roadmap to follow to become proficient in React in 2023. &lt;/p&gt;

&lt;p&gt;From learning the basics of JavaScript and HTML/CSS to building your first React app and delving into advanced concepts, this roadmap covers all the essential steps to becoming a proficient React developer. So let's get started!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1:  Learn the basics of Javascript
&lt;/h3&gt;

&lt;p&gt;Before you can begin learning React, you must first master the JavaScript programming language. Variables, data types, loops, and functions are examples of such concepts. You can skip this step if you are already familiar with JavaScript. Otherwise, there are numerous online resources to get you started, such as &lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; or &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" rel="noopener noreferrer"&gt;MDN Web Docs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Learn the basics of HTML and CSS
&lt;/h3&gt;

&lt;p&gt;React is used to build user interfaces, so it is important to have a basic understanding of HTML and CSS, which are used to structure and style web pages. If you are already familiar with these technologies, you can skip this step. Otherwise, there are many resources available online to help you get started, such as &lt;a href="https://www.freecodecamp.org/" rel="noopener noreferrer"&gt;FreeCodeCamp&lt;/a&gt; or &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript" rel="noopener noreferrer"&gt;MDN Web Docs&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Learn the fundamentals of the React
&lt;/h3&gt;

&lt;p&gt;Once you have a basic understanding of JavaScript and HTML/CSS, you are ready to start learning React. A good starting point would be reading the official React documentation, which provides a thorough overview of React and its core concepts. &lt;/p&gt;

&lt;p&gt;While the official React documentation is a great resource, I find that online tutorials and courses offer a more interactive and hands-on approach to learning the library, making them a better choice for those who prefer a more engaging learning experience. Here’s the list of some of the best platforms to learn React in 2023:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scrimba.com&lt;/li&gt;
&lt;li&gt;Udemy&lt;/li&gt;
&lt;li&gt;Youtube&lt;/li&gt;
&lt;li&gt;FreeCodeCamp&lt;/li&gt;
&lt;li&gt;and as always Youtube&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Step 4: Build your first React application
&lt;/h3&gt;

&lt;p&gt;Now that you have learned the fundamentals of React, it is time to put your knowledge into practice by building your first React app. Start with a simple project, such as a:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To-do list&lt;/li&gt;
&lt;li&gt;Weather app&lt;/li&gt;
&lt;li&gt;or a tic-tac-toe game&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will help you build the confidence and will boost your motivation towards learning and practicing React. Believe, me this is the most important step while learning React.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Learn about React advance concepts
&lt;/h3&gt;

&lt;p&gt;As you continue to learn React, you should try learning some advance concepts like state management, performance optimization, deployment and testing.&lt;/p&gt;

&lt;p&gt;Once, you get the grip on these concepts you can move towards &lt;a href="https://nextjs.org" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is Next.js
&lt;/h4&gt;

&lt;p&gt;In a nutshell, Next.js is a JavaScript framework that allows you to create superfast and extremely user-friendly static websites as well as React-based web applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;In conclusion, learning React in 2023 can be a rewarding and valuable investment for your career as a front-end developer. By following the roadmap outlined in this article and consistently putting in the time and effort to practice and build projects, you can become proficient in this powerful library and use it to build rich and interactive user interfaces. Don't get discouraged if you struggle at first, as learning any new technology takes time and practice. Keep at it and you will eventually become a React master.&lt;/p&gt;

&lt;p&gt;Orginally posted on &lt;a href="https://www.dhairyashah.dev/posts/5-steps-to-become-a-react-pro-in-2023/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
