<?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: Jonathan Peters</title>
    <description>The latest articles on DEV Community by Jonathan Peters (@qms85).</description>
    <link>https://dev.to/qms85</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%2F1063356%2F011b8948-a40d-4aff-9ed7-7a76219307d2.jpg</url>
      <title>DEV Community: Jonathan Peters</title>
      <link>https://dev.to/qms85</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/qms85"/>
    <language>en</language>
    <item>
      <title>Building a simple TCP port scanner in C</title>
      <dc:creator>Jonathan Peters</dc:creator>
      <pubDate>Fri, 03 Oct 2025 10:46:49 +0000</pubDate>
      <link>https://dev.to/qms85/building-a-simple-tcp-port-scanner-in-c-3a6o</link>
      <guid>https://dev.to/qms85/building-a-simple-tcp-port-scanner-in-c-3a6o</guid>
      <description>&lt;h1&gt;
  
  
  Building A Simple TCP Port Scanner in C
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how to build a basic TCP port scanner in C. Port scanning is a technique used to determine which ports on a target host are open. This knowledge is essential for network administration and security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scans ports 1–1024 (well-known ports) on the target (default: localhost)&lt;/li&gt;
&lt;li&gt;Reports open ports to the console&lt;/li&gt;
&lt;li&gt;Easy to extend for remote targets and custom port ranges&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Uses TCP sockets to attempt connections to each port.&lt;/li&gt;
&lt;li&gt;If a connection succeeds, the port is open.&lt;/li&gt;
&lt;li&gt;Each port is scanned sequentially.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

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

&lt;ul&gt;
&lt;li&gt;GCC or any C compiler&lt;/li&gt;
&lt;li&gt;Unix-like OS (Linux, macOS)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Build
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcc &lt;span class="nt"&gt;-o&lt;/span&gt; port_scanner port_scanner.c
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run
&lt;/h3&gt;



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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Code Explanation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;sys/socket.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;netinet/in.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;arpa/inet.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;unistd.h&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;
&lt;span class="kt"&gt;int&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="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sockfd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;sockaddr_in&lt;/span&gt; &lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin_family&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;AF_INET&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin_addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;s_addr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;inet_addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"127.0.0.1"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Scan localhost&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;sockfd&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AF_INET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SOCK_STREAM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&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="n"&gt;sockfd&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;perror&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Socket creation failed"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sin_port&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;htons&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;port&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="n"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sockfd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;sockaddr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;sizeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;serv_addr&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Port %d is open&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sockfd&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&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;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set up the target address&lt;/strong&gt; for scanning (&lt;code&gt;127.0.0.1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Iterate over the desired port range&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create a new socket&lt;/strong&gt; for each port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attempt to connect&lt;/strong&gt; to each port.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Print open ports&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Close the socket&lt;/strong&gt; to avoid resource leaks.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tips and Tricks
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use multithreading for faster scanning.&lt;/li&gt;
&lt;li&gt;Set timeouts to avoid hanging on closed ports.&lt;/li&gt;
&lt;li&gt;Accept IP/port range as input for flexibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Extensions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scan remote hosts by changing the IP address.&lt;/li&gt;
&lt;li&gt;Scan custom port ranges.&lt;/li&gt;
&lt;li&gt;Output results to a file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://beej.us/guide/bgnet/" rel="noopener noreferrer"&gt;Beej's Guide to Network Programming&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nmap.org/book/" rel="noopener noreferrer"&gt;Nmap Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.geeksforgeeks.org/socket-programming-cc/" rel="noopener noreferrer"&gt;Linux Socket Programming&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Learning Path
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Learn C and systems programming basics.&lt;/li&gt;
&lt;li&gt;Study networking fundamentals.&lt;/li&gt;
&lt;li&gt;Explore advanced topics like multithreading and asynchronous I/O.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Happy Scanning!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>networking</category>
      <category>programming</category>
      <category>tutorial</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>A responsive footer menu with social media icons</title>
      <dc:creator>Jonathan Peters</dc:creator>
      <pubDate>Sat, 03 May 2025 21:36:04 +0000</pubDate>
      <link>https://dev.to/qms85/a-responsive-footer-menu-with-social-media-icons-415o</link>
      <guid>https://dev.to/qms85/a-responsive-footer-menu-with-social-media-icons-415o</guid>
      <description>&lt;p&gt;Lets start with the HTML Code:&lt;br&gt;
HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Responsive Footer Menu&amp;lt;/title&amp;gt;
    &amp;lt;link rel="stylesheet" href="style.css"&amp;gt;
    &amp;lt;script defer src="script.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;footer class="footer"&amp;gt;
        &amp;lt;div class="footer-container"&amp;gt;
            &amp;lt;div class="footer-social"&amp;gt;
                &amp;lt;a href="https://wa.me/your-number" target="_blank" class="footer-social-icon"&amp;gt;
                    &amp;lt;img src="whatsapp-icon.png" alt="WhatsApp"&amp;gt;
                &amp;lt;/a&amp;gt;
                &amp;lt;a href="https://www.facebook.com/your-profile" target="_blank" class="footer-social-icon"&amp;gt;
                    &amp;lt;img src="facebook-icon.png" alt="Facebook"&amp;gt;
                &amp;lt;/a&amp;gt;
                &amp;lt;a href="https://www.linkedin.com/in/your-profile" target="_blank" class="footer-social-icon"&amp;gt;
                    &amp;lt;img src="linkedin-icon.png" alt="LinkedIn"&amp;gt;
                &amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;div class="footer-links"&amp;gt;
                &amp;lt;a href="#" class="footer-link"&amp;gt;Terms &amp;amp; Conditions&amp;lt;/a&amp;gt;
                &amp;lt;a href="#" class="footer-link"&amp;gt;Privacy Policy&amp;lt;/a&amp;gt;
                &amp;lt;a href="#" class="footer-link"&amp;gt;Contact Us&amp;lt;/a&amp;gt;
                &amp;lt;a href="#" class="footer-link"&amp;gt;About Us&amp;lt;/a&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
    &amp;lt;/footer&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next up, time to add some CSS Styling&lt;br&gt;
CSS:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
}

.footer {
    background-color: #333;
    color: white;
    padding: 20px 0;
    text-align: center;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-social {
    margin-bottom: 20px;
}

.footer-social-icon {
    margin: 0 10px;
}

.footer-social-icon img {
    width: 30px;
    height: 30px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: white;
    margin: 5px 15px;
    text-decoration: none;
}

.footer-link:hover {
    text-decoration: underline;
}

@media (min-width: 600px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .footer-social {
        margin-bottom: 0;
    }

    .footer-links {
        justify-content: flex-end;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Last but not least, lets add some JavaScript:&lt;br&gt;
JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// JavaScript code if needed for future enhancements
document.addEventListener('DOMContentLoaded', function() {
    // Placeholder for any future JavaScript functionality
    console.log("Footer loaded");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Code Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. HTML:&lt;/strong&gt; &lt;br&gt;
We create a &lt;code&gt;footer&lt;/code&gt; element with a class of &lt;code&gt;footer&lt;/code&gt;.&lt;br&gt;
Inside the footer, there's a &lt;code&gt;footer-container&lt;/code&gt; which contains two main sections: &lt;code&gt;footer-social&lt;/code&gt; and &lt;code&gt;footer-links&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;footer-social&lt;/code&gt; contains anchor tags (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;) with links to WhatsApp, Facebook, and LinkedIn. Each anchor tag wraps an image representing the social media icon.&lt;br&gt;
&lt;code&gt;footer-links&lt;/code&gt; contains anchor tags pointing to different pages such as Terms &amp;amp; Conditions, Privacy Policy, Contact Us, and About Us.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. CSS:&lt;/strong&gt;&lt;br&gt;
Basic styles are applied to all elements to ensure consistent box-sizing and remove default margins and paddings.&lt;br&gt;
The &lt;code&gt;body&lt;/code&gt; is set to use flexbox to ensure the footer is positioned at the bottom of the viewport.&lt;br&gt;
The &lt;code&gt;footer&lt;/code&gt; section has a dark background color and white text, with padding for spacing.&lt;br&gt;
The &lt;code&gt;footer-container&lt;/code&gt; uses flexbox to align its children elements in a column on small screens and a row on larger screens.&lt;br&gt;
Social media icons are styled to have a specific size, and links are styled for better visibility and interactivity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. JavaScript:&lt;/strong&gt;&lt;br&gt;
A basic JavaScript snippet is included to handle any future enhancements. Currently, it only logs a message when the footer is loaded.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tips &amp;amp; Tricks:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Responsive Design: Use media queries to adjust the layout for different screen sizes. Here, we switch from column to row layout on screens wider than 600px.&lt;/li&gt;
&lt;li&gt;Flexbox: Utilizes flexbox for easy alignment and spacing of elements.&lt;/li&gt;
&lt;li&gt;External Links: Ensure social media links open in a new tab using &lt;code&gt;target="_blank"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Accessibility: Provide descriptive alt attributes for images to improve accessibility.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>footer</category>
      <category>responsivewebdesign</category>
      <category>frontendwebdevelopment</category>
      <category>frontend</category>
    </item>
    <item>
      <title>What is an API? &amp; How can i start building API's using JavaScript???</title>
      <dc:creator>Jonathan Peters</dc:creator>
      <pubDate>Sat, 03 May 2025 21:00:07 +0000</pubDate>
      <link>https://dev.to/qms85/what-is-an-api-how-can-i-start-building-apis-using-javascript-50k6</link>
      <guid>https://dev.to/qms85/what-is-an-api-how-can-i-start-building-apis-using-javascript-50k6</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is an API?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An API (Application Programming Interface) is a set of rules and protocols that allows two applications to communicate with each other. Think of it as a bridge that enables software systems to exchange data and functionality.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;When you use a weather app on your phone, it fetches live weather data from a remote server using an API.&lt;br&gt;
APIs allow developers to access features or data from external systems without needing to know how those systems are implemented.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Types of APIs&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;REST API (Representational State Transfer): Based on HTTP methods (GET, POST, PUT, DELETE).&lt;/li&gt;
&lt;li&gt;GraphQL API: Allows fetching specific data using queries.&lt;/li&gt;
&lt;li&gt;SOAP API (Simple Object Access Protocol): Uses XML for communication.
**
Getting Started with Building APIs using JavaScript**
To build APIs with JavaScript, you can use Node.js. 
Here's a step-by-step guide:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;1. Install Node.js&lt;/strong&gt;&lt;br&gt;
Download and install Node.js from &lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;https://nodejs.org&lt;/a&gt;.&lt;br&gt;
Verify installation:&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;node -v&lt;br&gt;
npm -v&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Set Up a New Project&lt;/strong&gt;&lt;br&gt;
Create a new folder for your project:&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;mkdir my-api&lt;br&gt;
cd my-api&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Initialize the project:&lt;/strong&gt;&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;npm init -y&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will generate a &lt;code&gt;package.json&lt;/code&gt; file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Install Express.js&lt;/strong&gt;&lt;br&gt;
Express.js is a popular framework for building APIs with Node.js.&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;npm install express&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Create a Basic API&lt;/strong&gt;&lt;br&gt;
Here's a simple example to create a REST API:&lt;br&gt;
JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Import the Express.js library
const express = require('express');

// Initialize the Express app
const app = express();

// Middleware to parse JSON data
app.use(express.json());

// Define a simple GET endpoint
app.get('/', (req, res) =&amp;gt; {
  res.send('Welcome to my API!');
});

// Define a GET endpoint for retrieving data
app.get('/api/users', (req, res) =&amp;gt; {
  const users = [
    { id: 1, name: 'Alice' },
    { id: 2, name: 'Bob' },
  ];
  res.json(users);
});

// Define a POST endpoint for creating data
app.post('/api/users', (req, res) =&amp;gt; {
  const newUser = req.body; // Get data from the request body
  newUser.id = Date.now(); // Generate a unique ID
  res.status(201).json(newUser); // Respond with the created user
});

// Start the server
const PORT = 3000;
app.listen(PORT, () =&amp;gt; {
  console.log(`Server is running on http://localhost:${PORT}`);
});

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Run the API&lt;/strong&gt;&lt;br&gt;
Save the file as &lt;code&gt;index.js&lt;/code&gt; and run:&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;node index.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Access the API endpoints in your browser or using tools like Postman or cURL:&lt;br&gt;
&lt;code&gt;GET /&lt;/code&gt; → &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt;&lt;br&gt;
&lt;code&gt;GET /api/users&lt;/code&gt; → &lt;a href="http://localhost:3000/api/users" rel="noopener noreferrer"&gt;http://localhost:3000/api/users&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Explanation of the Code&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Import Express.js:**
&lt;code&gt;const express = require('express');&lt;/code&gt;  imports the Express.js module.
&lt;strong&gt;2. Initialize the App:&lt;/strong&gt;
&lt;code&gt;const app = express();&lt;/code&gt; initializes the application.
&lt;strong&gt;3. Middleware:&lt;/strong&gt;
&lt;code&gt;app.use(express.json());&lt;/code&gt;  allows us to parse JSON data in API requests.
&lt;strong&gt;4. Define Endpoints:&lt;/strong&gt;
&lt;code&gt;app.get()&lt;/code&gt; handles GET requests.
&lt;code&gt;app.post()&lt;/code&gt; handles POST requests.
&lt;strong&gt;5. Start the Server:&lt;/strong&gt;
&lt;code&gt;app.listen(PORT, callback)&lt;/code&gt; starts the server and listens for incoming requests.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Tips &amp;amp; Tricks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-Use Postman or Insomnia to test your API endpoints.&lt;br&gt;
-Use nodemon to automatically restart your server during development:&lt;br&gt;
bash:&lt;br&gt;
&lt;code&gt;npm install -g nodemon&lt;br&gt;
nodemon index.js&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Further Study&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;-Learn about HTTP Methods (GET, POST, PUT, DELETE).&lt;br&gt;
-Explore middleware in Express.js (e.g., authentication, logging).&lt;br&gt;
-Learn about CORS (Cross-Origin Resource Sharing) if you’re making API calls from a frontend.&lt;br&gt;
-Learn to handle and validate request data using libraries like Joi or express-validator.&lt;/p&gt;

</description>
      <category>api</category>
      <category>javascript</category>
      <category>frontend</category>
      <category>code</category>
    </item>
  </channel>
</rss>
