<?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: Abhinav Kumar</title>
    <description>The latest articles on DEV Community by Abhinav Kumar (@humhaiabhinav).</description>
    <link>https://dev.to/humhaiabhinav</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%2F763376%2F685c79b9-3737-46a1-ade3-16aaba898d33.jpeg</url>
      <title>DEV Community: Abhinav Kumar</title>
      <link>https://dev.to/humhaiabhinav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/humhaiabhinav"/>
    <language>en</language>
    <item>
      <title>Node.js for Beginners: Chapter 2 – Crafting Your First REST API (Like a Boss) 🚀</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Sun, 30 Mar 2025 05:19:19 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/nodejs-for-beginners-chapter-2-crafting-your-first-rest-api-like-a-boss-1190</link>
      <guid>https://dev.to/humhaiabhinav/nodejs-for-beginners-chapter-2-crafting-your-first-rest-api-like-a-boss-1190</guid>
      <description>&lt;p&gt;Hey, you’re back! 🙌 Chapter 1 was all about &lt;em&gt;what&lt;/em&gt; Node.js is—now it’s time to &lt;strong&gt;build something real&lt;/strong&gt;. By the end of this, you’ll have a working REST API that serves data, handles requests, and makes you feel like a coding wizard. No magic wand required—just JavaScript.  &lt;/p&gt;

&lt;p&gt;Let’s get this bread.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Express.js: Your API’s New BFF&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Node.js is powerful, but writing a server from scratch? That’s like building a car to drive to the grocery store. &lt;strong&gt;Express.js&lt;/strong&gt; is the Tesla of backend frameworks—minimal setup, &lt;em&gt;maximum speed&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why Express?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Simplifies routing (mapping URLs to code).
&lt;/li&gt;
&lt;li&gt;Adds middleware (think: plugins for your server).
&lt;/li&gt;
&lt;li&gt;Used by &lt;strong&gt;Netflix, Uber, and X(Twitter)&lt;/strong&gt; (no big deal).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;REST APIs in 60 Seconds ⏳&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A REST API lets apps talk to each other over HTTP. Imagine your React app asking your Node.js server: &lt;em&gt;“Hey, can I get some data?”&lt;/em&gt; and the server replying &lt;em&gt;“Sure, here’s a JSON file!”&lt;/em&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key concepts:&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Endpoints&lt;/strong&gt;: URLs like &lt;code&gt;/api/users&lt;/code&gt; or &lt;code&gt;/api/posts&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;HTTP Methods&lt;/strong&gt;: &lt;code&gt;GET&lt;/code&gt; (read), &lt;code&gt;POST&lt;/code&gt; (create), &lt;code&gt;PUT&lt;/code&gt; (update), &lt;code&gt;DELETE&lt;/code&gt; (…you get it).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CRUD&lt;/strong&gt;: Create, Read, Update, Delete (the four commandments of APIs).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Let’s Build a To-Do API (Because Why Not?)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We’re building a simple API to track tasks. Even Zuckerberg started with “Hello, World.”  &lt;/p&gt;

&lt;h4&gt;
  
  
  Step 1: Set Up the Project
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Create a folder and initialize npm:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;mkdir &lt;/span&gt;todo-api &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;todo-api  
   npm init &lt;span class="nt"&gt;-y&lt;/span&gt;  &lt;span class="c"&gt;# -y = "Yes to everything, I’m lazy"  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install Express:
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: The Bare Minimum Server
&lt;/h4&gt;

&lt;p&gt;Create &lt;code&gt;server.js&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

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

&lt;span class="c1"&gt;// Let Express parse JSON (so you can send data in POST requests)  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&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="c1"&gt;// Basic route  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Your API is alive! 🎉&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;  

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

&lt;/div&gt;



&lt;p&gt;Run it:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Visit &lt;code&gt;http://localhost:3000&lt;/code&gt; in your browser. If you see the message, &lt;em&gt;you’ve just built a server&lt;/em&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Adding CRUD Endpoints&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let’s fake a database (for now) using an array.&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="c1"&gt;// Fake "database"  &lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;todos&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="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Learn Node.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;  
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Build an API&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;  
&lt;span class="p"&gt;];&lt;/span&gt;  

&lt;span class="c1"&gt;// GET all todos  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/api/todos&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;  

&lt;span class="c1"&gt;// POST a new todo  &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="s1"&gt;/api/todos&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;newTodo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="na"&gt;task&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  
    &lt;span class="na"&gt;done&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;  
  &lt;span class="p"&gt;};&lt;/span&gt;  
  &lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newTodo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&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="nx"&gt;newTodo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// 201 = "Created"  &lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Test it with Postman:&lt;/strong&gt;  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Send a &lt;code&gt;GET&lt;/code&gt; to &lt;code&gt;http://localhost:3000/api/todos&lt;/code&gt; – you’ll see your fake todos.
&lt;/li&gt;
&lt;li&gt;Send a &lt;code&gt;POST&lt;/code&gt; with JSON body &lt;code&gt;{ "task": "Buy coffee" }&lt;/code&gt; – watch your array grow!
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Middleware: The Secret Sauce&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Middleware functions can:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log requests.
&lt;/li&gt;
&lt;li&gt;Authenticate users.
&lt;/li&gt;
&lt;li&gt;Handle errors.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example: Add a request logger&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Log every request  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`[&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toISOString&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;method&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Pass control to the next middleware  &lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your terminal will show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[2025-06-15T10:30:00Z] GET /api/todos  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Error Handling (Because Stuff Breaks)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Ever seen “Cannot GET /api/todo”? Let’s fix that.&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="c1"&gt;// Handle 404s  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&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;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Route not found. Did you mean /api/todos?&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;  

&lt;span class="c1"&gt;// Global error handler  &lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;  
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;stack&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&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;error&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Oops, our server had a ☕ moment.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;Why This Matters&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Foundational Skills&lt;/strong&gt;: Every backend role expects REST API knowledge.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full-Stack Power&lt;/strong&gt;: Connect this API to your React/Vue frontend tomorrow.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Later, swap the fake array with MongoDB/Postgres.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Level Up: 3 Pro Tips&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Use &lt;code&gt;nodemon&lt;/code&gt; to auto-restart your server on changes:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; nodemon  
   nodemon server.js  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Structure your code with folders like &lt;code&gt;routes/&lt;/code&gt; and &lt;code&gt;controllers/&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always validate data&lt;/strong&gt; (try the &lt;code&gt;joi&lt;/code&gt; library).
&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Quiz Time! 🧠&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Test your Express knowledge here:&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://www.examshala.in/module/expressjs-beginner-quiz/intro" rel="noopener noreferrer"&gt;Express.JS Quiz&lt;/a&gt;  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What’s Next?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In Chapter 3, we’ll &lt;strong&gt;connect this API to a real database&lt;/strong&gt; (MongoDB) and deploy it to the cloud. Until then:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add &lt;code&gt;PUT&lt;/code&gt; and &lt;code&gt;DELETE&lt;/code&gt; endpoints.
&lt;/li&gt;
&lt;li&gt;Experiment with &lt;a href="https://postman.com" rel="noopener noreferrer"&gt;Postman&lt;/a&gt; to test your routes.
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Still &lt;strong&gt;Abhinav&lt;/strong&gt;, still caffeinated. I once spent 3 hours debugging an API only to realize I forgot a comma. Now I write guides so &lt;em&gt;you&lt;/em&gt; don’t have to. Find more rants and memes at &lt;a href="https://www.examshala.in" rel="noopener noreferrer"&gt;ExamShala.in&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; Hit a wall? Screenshot your code and tag me on &lt;a href="https://twitter.com/ExamShala" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;. Let’s fix it together! 💪&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>Node.js in 2025: Tools So Good, They’ll Make You Side-Eye Your Old Code</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Tue, 18 Mar 2025 17:31:14 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/nodejs-in-2025-tools-so-good-theyll-make-you-side-eye-your-old-code-o60</link>
      <guid>https://dev.to/humhaiabhinav/nodejs-in-2025-tools-so-good-theyll-make-you-side-eye-your-old-code-o60</guid>
      <description>&lt;p&gt;Hey you. Yeah, &lt;em&gt;you&lt;/em&gt;—the one still using &lt;code&gt;npm install&lt;/code&gt; like it’s a meditation app. Let’s talk. The Node.js world in 2025 is basically the tech version of a glow-up montage, and if you’re not paying attention, you’ll be stuck maintaining legacy code while the cool kids deploy AI-powered edge functions.  &lt;/p&gt;

&lt;p&gt;Don’t worry, I’ve got you. Here’s the &lt;strong&gt;unapologetically opinionated guide&lt;/strong&gt; to Node.js tools that matter now.  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. Bun: Node.js on Red Bull 🚀&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: A Zig-powered runtime that laughs at your &lt;code&gt;node_modules&lt;/code&gt; folder and says, “That’s cute.”  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you’ll stan&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Runs TypeScript like it’s plain JS. &lt;em&gt;No, you don’t need &lt;code&gt;ts-node&lt;/code&gt; anymore, Karen&lt;/em&gt;.
&lt;/li&gt;
&lt;li&gt;Replaces &lt;code&gt;npm&lt;/code&gt;, &lt;code&gt;yarn&lt;/code&gt;, and &lt;code&gt;webpack&lt;/code&gt; in one binary. Your CI/CD pipeline just got a promotion.
&lt;/li&gt;
&lt;li&gt;Cold starts faster than your ex moving on.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Try it or stay mid&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;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://bun.sh/install | bash  
bun create chaos &lt;span class="c"&gt;# Because "my-cool-app" is boring  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;2. Deno: Node.js But It Actually Locks the Door 🔒&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: Node’s more responsible cousin who checks for monsters under the bed.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it slaps&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;TypeScript out of the box. &lt;em&gt;Yes, Ryan Dahl fixed his own mistakes&lt;/em&gt;.
&lt;/li&gt;
&lt;li&gt;Permissions system: “Can this script read your files?” → “lol no.”
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fresh framework&lt;/strong&gt;: Next.js if it did yoga and drank green juice.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Deno in action&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;deno run &lt;span class="nt"&gt;--allow-net&lt;/span&gt; &lt;span class="nt"&gt;--allow-env&lt;/span&gt; &lt;span class="nt"&gt;--allow-sarcasm&lt;/span&gt; server.ts  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;3. Edge Functions: Serverless, But Make It ✨Vibe✨&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: Running code closer to users than your last toxic relationship.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s a flex&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Responds faster than a Twitter troll.
&lt;/li&gt;
&lt;li&gt;Costs less than your monthly coffee addiction.
&lt;/li&gt;
&lt;li&gt;Deploys to 300+ locations. &lt;em&gt;Global domination, but make it async&lt;/em&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code snippet for the aesthetic&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Vercel Edge Function  &lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default &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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Sup from &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;geo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;city&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;4. TypeScript: JavaScript’s Glow-Up 💅&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: The reason your code doesn’t look like a toddler’s finger painting anymore.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why you’re not allowed to skip it&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Catches bugs before they ghost your production server.
&lt;/li&gt;
&lt;li&gt;AI tools (&lt;em&gt;looking at you, Copilot&lt;/em&gt;) simp hard for typed code.
&lt;/li&gt;
&lt;li&gt;Bun/Deno treat it like a first-class citizen. &lt;em&gt;Node.js, take notes&lt;/em&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Hot tip&lt;/strong&gt;: Replace &lt;code&gt;tsc&lt;/code&gt; with &lt;code&gt;swc&lt;/code&gt; and watch your compile times drop like it’s hot.  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. Nx: Monorepos That Won’t Make You Cry 🧩&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: A monorepo tool that doesn’t hate your guts.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s a W&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Shares code like your aunt shares conspiracy theories—effortlessly.
&lt;/li&gt;
&lt;li&gt;Caches builds like a squirrel hoarding acorns.
&lt;/li&gt;
&lt;li&gt;Supports React, Vue, and even that Angular app you inherited (RIP).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Start here&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 create-nx-workspace@latest my-empire  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;6. tRPC: REST’s Funeral Director ⚰️&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: REST APIs are dead. tRPC is the typesafe heir.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s a vibe&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend and backend share types like besties sharing fries.
&lt;/li&gt;
&lt;li&gt;Zero boilerplate. &lt;em&gt;Yes, even the docs are shorter than a TikTok&lt;/em&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code flex&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Backend  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;appRouter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;router&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;  
  &lt;span class="na"&gt;roastMe&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;publicProcedure&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Your code is 🔥…ly bad.&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="p"&gt;});&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;7. AI Tools: Your New Overlords 🤖&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: Code that writes itself while you binge Netflix.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hot picks&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LangChain.js&lt;/strong&gt;: For when you want ChatGPT to do your job.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vercel AI SDK&lt;/strong&gt;: Because typing is &lt;em&gt;so&lt;/em&gt; 2024.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Effect-TS&lt;/strong&gt;: Functional programming for masochists who love type theory.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example (or don’t)&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// GPT-6 writes your API  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="p"&gt;}&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;ai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Make me famous&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;h2&gt;
  
  
  &lt;strong&gt;8. Biome: ESLint’s Death Certificate 🪦&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;What it is&lt;/strong&gt;: A Rust-powered linter that’s faster than your excuses.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why it’s iconic&lt;/strong&gt;:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Formats + lints in one. &lt;em&gt;Bye, Prettier—it’s not you, it’s us&lt;/em&gt;.
&lt;/li&gt;
&lt;li&gt;Config so simple, even your PM could use it (maybe).
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Join the cult&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 @biomejs/biome init &lt;span class="nt"&gt;--yes&lt;/span&gt; &lt;span class="c"&gt;# Because "no" is not an option  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;Quiz Time (No Cheating) 🧪&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Think you’re a Node.js 2025 guru? Prove it:&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://www.examshala.in/module/nodejs-beginner-quiz/intro" rel="noopener noreferrer"&gt;Node.js 2025 Quiz&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;(Spoiler: You’ll fail. But that’s why we learn.)&lt;/em&gt;  &lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;TL;DR for the Impatient&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ditch Node.js&lt;/strong&gt; for Bun/Deno unless you love waiting.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Edge &amp;gt; Serverless&lt;/strong&gt;. Fight me.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TypeScript or GTFO&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Abhinav&lt;/strong&gt; here—a recovering &lt;code&gt;console.log&lt;/code&gt; addict and CTO of &lt;a href="https://examshala.in" rel="noopener noreferrer"&gt;ExamShala.in&lt;/a&gt;. I write about code, career fails, and why you should never trust a dev who doesn’t meme.  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Node.js for Beginners: Chapter 1 – Your First Steps into Backend Magic ✨</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Tue, 18 Mar 2025 17:16:40 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/nodejs-for-beginners-chapter-1-your-first-steps-into-backend-magic-58dm</link>
      <guid>https://dev.to/humhaiabhinav/nodejs-for-beginners-chapter-1-your-first-steps-into-backend-magic-58dm</guid>
      <description>&lt;p&gt;Hey there! 👋 So you’ve been writing JavaScript for the browser, but now you’re hearing whispers about this thing called &lt;strong&gt;Node.js&lt;/strong&gt;. Maybe your friend won’t stop raving about it, or you saw it listed in 10,000 job postings. Either way, you’re here—and I promise, by the end of this, you’ll &lt;em&gt;get&lt;/em&gt; why Node.js is a big freakin’ deal.  &lt;/p&gt;

&lt;p&gt;Let’s break it down like we’re chatting over coffee. No jargon. No pressure.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What the Heck is Node.js?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Node.js isn’t a new language (phew!). It’s a &lt;strong&gt;JavaScript runtime&lt;/strong&gt;—basically a tool that lets you run JavaScript &lt;em&gt;outside your browser&lt;/em&gt;. Think servers, command-line tools, or even robots. 🤖  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why should you care?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build &lt;strong&gt;backend APIs&lt;/strong&gt; for your React/Vue apps (no more begging backend devs for endpoints!).
&lt;/li&gt;
&lt;li&gt;Use JavaScript everywhere (&lt;strong&gt;frontend + backend = 💖&lt;/strong&gt;).
&lt;/li&gt;
&lt;li&gt;Tap into &lt;strong&gt;npm&lt;/strong&gt;, the largest library of free code snippets on Earth (seriously, there’s a package for everything—even &lt;a href="https://www.npmjs.com/package/left-pad" rel="noopener noreferrer"&gt;left-pad&lt;/a&gt;).
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;The “Aha!” Moment: How Node.js Works&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Traditional servers (like PHP) handle one request at a time. Node.js? It’s like a &lt;strong&gt;multitasking wizard&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;Here’s the secret sauce:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Non-blocking I/O&lt;/strong&gt;: Instead of waiting for a file to load or a database query to finish, Node.js says, “You do your thing—I’ll handle other stuff meanwhile.”
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event Loop&lt;/strong&gt;: A fancy term for “I’ll call you back when I’m ready.” (Sound familiar? Yep, just like browser JavaScript!)
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Real-world example&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
Uber uses Node.js to handle millions of ride requests &lt;em&gt;at the same time&lt;/em&gt;. Your side project’s API can do that too. 😎  &lt;/p&gt;


&lt;h3&gt;
  
  
  &lt;strong&gt;Let’s Get Our Hands Dirty&lt;/strong&gt;
&lt;/h3&gt;
&lt;h4&gt;
  
  
  Step 1: Install Node.js
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://nodejs.org" rel="noopener noreferrer"&gt;nodejs.org&lt;/a&gt; and download the &lt;strong&gt;LTS version&lt;/strong&gt; (it’s the stable one).
&lt;/li&gt;
&lt;li&gt;Open your terminal and type:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   node &lt;span class="nt"&gt;-v&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you see a version number (like v22.14.0), congrats! 🎉  &lt;/p&gt;
&lt;h4&gt;
  
  
  Step 2: Your First Script
&lt;/h4&gt;

&lt;p&gt;Create a file called &lt;code&gt;app.js&lt;/code&gt; and add 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="c1"&gt;// app.js  &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello, Node.js!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="c1"&gt;// Yes, it's just JavaScript. No, the browser isn't involved. 🤯  &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run it with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;If you see “Hello, Node.js!”—you’ve just run server-side JavaScript. Welcome to the dark side.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Core Concepts (Without the Boring Stuff)&lt;/strong&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  1. Modules: Reusable Code Chunks
&lt;/h4&gt;

&lt;p&gt;Node.js uses modules to organize code. 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="c1"&gt;// Import the 'fs' module to read files  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;fs&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  

&lt;span class="c1"&gt;// Read a file  &lt;/span&gt;
&lt;span class="nx"&gt;fs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;my-file.txt&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="s1"&gt;utf8&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;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&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;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&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;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Outputs the file content  &lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  2. npm: Your New Best Friend
&lt;/h4&gt;

&lt;p&gt;npm (Node Package Manager) lets you install tools like Express.js (for APIs) or Axios (for HTTP requests). Try this:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  3. Asynchronous ≠ Scary
&lt;/h4&gt;

&lt;p&gt;Callback functions, promises, and async/await are your tools for handling tasks that take time (like fetching data). Start with 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="c1"&gt;// Async/Await example  &lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://api.example.com/data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&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;response&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="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;data&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;h3&gt;
  
  
  &lt;strong&gt;Why Should YOU Learn Node.js?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Job Opportunities&lt;/strong&gt;: Node.js devs earn $90K–$150K (depending on experience).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build Full-Stack Apps&lt;/strong&gt;: No context-switching between languages.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It’s Fun&lt;/strong&gt;: Automate tasks, build APIs, or even create a Discord bot.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Quiz Time! 🧠&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Test your Node.js basics with this &lt;strong&gt;free quiz&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://www.examshala.in/module/nodejs-beginner-quiz/intro" rel="noopener noreferrer"&gt;Node.js Beginner Quiz&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;(No signup required—just click and learn where you stand!)  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;What’s Next?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In Chapter 2, we’ll build a &lt;strong&gt;REST API with Express.js&lt;/strong&gt; (spoiler: it’s easier than you think). Until then:  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Mess around with &lt;code&gt;fs&lt;/code&gt; module (read/write files).
&lt;/li&gt;
&lt;li&gt;Install a fun npm package (try &lt;a href="https://www.npmjs.com/package/chalk" rel="noopener noreferrer"&gt;chalk&lt;/a&gt; for colorful console logs!).
&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;strong&gt;About the Author&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
I’m &lt;strong&gt;Abhinav&lt;/strong&gt;, a developer who accidentally fell in love with Node.js while building a cat meme generator API. I write at &lt;a href="https://www.examshala.in" rel="noopener noreferrer"&gt;ExamShala.in&lt;/a&gt; about coding, career hacks, and why you should never trust a dev who doesn’t drink coffee.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; Stuck? Drop a comment below or ping me on &lt;a href="https://twitter.com/ExamShala" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;. I don’t bite! 😊  &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Top 10 Programming Languages to Learn in 2025 (And Why They Matter)</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Tue, 11 Mar 2025 12:55:15 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/top-10-programming-languages-to-learn-in-2025-3j38</link>
      <guid>https://dev.to/humhaiabhinav/top-10-programming-languages-to-learn-in-2025-3j38</guid>
      <description>&lt;p&gt;Let’s face it—choosing which programming language to learn can feel overwhelming. With tech evolving faster than ever, you don’t want to waste time on a language that fades out next year. But don’t stress. After digging into job boards, talking to developers, and even arguing with my coworkers at ExamShala.in, here’s my no-BS guide to the &lt;strong&gt;10 languages that’ll actually boost your career in 2025&lt;/strong&gt;. I’ll explain &lt;em&gt;why&lt;/em&gt; each one matters, &lt;em&gt;where&lt;/em&gt; they’re used, and even toss in some real-world examples so you can see their impact.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Python: The Swiss Army Knife&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Yeah, you’ve heard this before, but Python isn’t just hype. I’ve seen interns pick it up in weeks and build machine learning models by month three. Why? Because &lt;strong&gt;readability is its superpower&lt;/strong&gt;. Want to automate boring tasks? Python. Dream of working on AI? Python’s TensorFlow and PyTorch libraries are the backbone of tools like Netflix’s recommendation engine. Even NASA uses it for data analysis!  &lt;/p&gt;

&lt;p&gt;But here’s the kicker: &lt;strong&gt;Python’s community is insane&lt;/strong&gt;. Stuck on a problem? There’s a 99% chance someone’s already solved it on Stack Overflow. Whether you’re scraping websites with Beautiful Soup or building a backend with Django, Python feels like coding with training wheels—in the best way.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Java: The Enterprise Titan&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Java’s been around since the ’90s, and guess what? It’s not going anywhere. Why? &lt;strong&gt;Stability&lt;/strong&gt;. Banks like Goldman Sachs rely on Java for trading systems because it’s secure and handles massive scale. Android apps? Yep—Spotify and Twitter (at least parts of it) still run on Java.  &lt;/p&gt;

&lt;p&gt;But here’s why &lt;em&gt;you&lt;/em&gt; should care: &lt;strong&gt;Java’s ecosystem is a job machine&lt;/strong&gt;. From Spring Boot for microservices to Hadoop for big data, Java tools are everywhere. Plus, Oracle’s constant updates (hello, new features every 6 months!) keep it modern. If you want a language that pays the bills, Java’s your guy.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;3. JavaScript: The Web’s Beating Heart&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Without JavaScript, the internet would be a bunch of static text. Seriously. &lt;strong&gt;Every time you see a popup, animation, or real-time chat, that’s JavaScript&lt;/strong&gt;. But it’s not just for front-end magic anymore. With Node.js, you can build entire backends—Netflix and PayPal use it for lightning-fast server-side processing.  &lt;/p&gt;

&lt;p&gt;Frameworks? Oh boy. &lt;strong&gt;React (Meta), Angular (Google), and Vue.js&lt;/strong&gt; dominate front-end jobs. Want proof? Check LinkedIn—there are 5x more React openings than you can shake a stick at. And TypeScript (more on that later) is making JS even more powerful.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. C++: Speed Demon for the Pros&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;C++ isn’t for the faint of heart, but if you want &lt;strong&gt;raw power&lt;/strong&gt;, this is it. Game engines like Unreal Engine (think Fortnite) run on C++. High-frequency trading systems? C++. Even your car’s infotainment system probably uses it.  &lt;/p&gt;

&lt;p&gt;Why learn it in 2025? &lt;strong&gt;Control&lt;/strong&gt;. Unlike Python, C++ lets you manage memory directly. That means faster, more efficient code—critical for VR, robotics, or anything needing real-time performance. Just brace yourself for pointers and manual debugging.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. C#: Microsoft’s Power Player&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;C# is like Java’s cooler cousin. &lt;strong&gt;Unity, the game engine behind Among Us and Pokémon GO, runs on C#&lt;/strong&gt;. But it’s not just for games. Companies like Stack Overflow use C# with ASP.NET for robust web apps.  &lt;/p&gt;

&lt;p&gt;Microsoft’s backing means &lt;strong&gt;tight integration with Azure (cloud) and tools like Visual Studio&lt;/strong&gt;. Plus, with MAUI, you can build cross-platform mobile apps. If you’re into enterprise software or gaming, C# is a golden ticket.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;6. TypeScript: JavaScript’s Smarter Sibling&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;JavaScript’s flexibility is a double-edged sword. Ever spent hours debugging because you typoed a variable name? TypeScript fixes that with &lt;strong&gt;static typing&lt;/strong&gt;. Companies like Airbnb and Slack use it to catch errors early and scale codebases.  &lt;/p&gt;

&lt;p&gt;It’s not a separate language—just JS with training wheels. &lt;strong&gt;Angular and React strongly recommend TypeScript now&lt;/strong&gt;, and job postings increasingly list it as a “nice-to-have.” Trust me, learning it now will save you headaches later.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. SQL: The Data Whisperer&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Data is king, and SQL is how you talk to it. &lt;strong&gt;Every app with a database (so, all of them) uses SQL&lt;/strong&gt;. Amazon’s product recommendations? Built on SQL queries. Analysts at Spotify use it to track your listening habits.  &lt;/p&gt;

&lt;p&gt;Even if you’re not a database admin, &lt;strong&gt;knowing SQL makes you stand out&lt;/strong&gt;. It’s the #1 skill for data science roles, and tools like PostgreSQL and MySQL aren’t disappearing anytime soon.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;8. C: The OG Language&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;C is the granddaddy of programming. &lt;strong&gt;Linux, Windows, and macOS kernels? All C&lt;/strong&gt;. Embedded systems like smart thermostats and medical devices? Yep. It’s fast, lightweight, and teaches you how computers &lt;em&gt;actually work&lt;/em&gt;.  &lt;/p&gt;

&lt;p&gt;While newer languages abstract away the nitty-gritty, &lt;strong&gt;C forces you to understand memory management and hardware&lt;/strong&gt;. It’s brutal but rewarding—like coding boot camp for your brain.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;9. Go (Golang): The Cloud’s Best Friend&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Go was built by Google to solve modern problems. &lt;strong&gt;Docker and Kubernetes? Written in Go&lt;/strong&gt;. Why? It’s stupidly simple, compiles fast, and handles concurrent tasks (like thousands of users hitting a server) effortlessly.  &lt;/p&gt;

&lt;p&gt;Uber uses Go for microservices because it scales without crashing. If you’re into DevOps or cloud engineering, &lt;strong&gt;Go + AWS/Azure = job security&lt;/strong&gt;.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;10. PHP: The Underdog You Can’t Ignore&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;PHP gets shade, but &lt;strong&gt;78% of websites run on it&lt;/strong&gt;, including WordPress (which powers 43% of the web). Facebook started with PHP, and companies like Etsy still use it for backend logic.  &lt;/p&gt;

&lt;p&gt;Is it glamorous? No. But &lt;strong&gt;freelance opportunities are endless&lt;/strong&gt;—small businesses love WordPress, and someone’s gotta build their plugins.  &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Honorable Mentions (Watch These!)&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rust&lt;/strong&gt;: Loved by developers for memory safety. Used in Firefox and blockchain projects.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Swift&lt;/strong&gt;: iOS devs swear by it—Apple’s ecosystem is too lucrative to ignore.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Kotlin&lt;/strong&gt;: Google’s pushing it for Android. Cleaner syntax than Java, same power.
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;How to Learn Without Losing Your Mind&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;At ExamShala.in, we’ve got &lt;strong&gt;free quizzes&lt;/strong&gt; to test your basics. No fluff—just hands-on practice:&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Python&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/python-beginner-quiz/intro" rel="noopener noreferrer"&gt;Python Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Java&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/java-beginner-quiz/intro" rel="noopener noreferrer"&gt;Java Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;JavaScript&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/javascript-beginner-quiz/intro" rel="noopener noreferrer"&gt;JavaScript Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;C++&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/cpp-beginner-quiz/intro" rel="noopener noreferrer"&gt;C++ Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;C#&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/csharp-beginner-quiz-2/intro" rel="noopener noreferrer"&gt;C# Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;TypeScript&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/typescript-beginner-mocktest/intro" rel="noopener noreferrer"&gt;Basic TypeScript Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;SQL&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/sql-beginner-quiz/intro" rel="noopener noreferrer"&gt;SQL Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;C&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/c-beginner-quiz/intro" rel="noopener noreferrer"&gt;C Basic Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;Go (Golang)&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/golang-beginner-mocktest/intro" rel="noopener noreferrer"&gt;Basic Go Quiz - Free&lt;/a&gt;&lt;br&gt;&lt;br&gt;
🔹 &lt;strong&gt;PHP&lt;/strong&gt; – &lt;a href="https://www.examshala.in/module/php-beginner-quiz/intro" rel="noopener noreferrer"&gt;PHP Basic Quiz - Free&lt;/a&gt;   &lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;About Me&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;I’m &lt;strong&gt;Abhinav&lt;/strong&gt;, a developer who’s built everything from fintech apps to AI chatbots. At ExamShala.in, I focus on cutting through the noise—no “learn this because everyone else does.” Just real talk from someone who’s been in the trenches.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S.&lt;/strong&gt; Still stuck deciding? Hit me up on Twitter [@ExamShala]. I’ll help you pick based on your goals. 😊  &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; Python and JavaScript are safe bets, but niche languages like Go or Rust could make you stand out. Choose based on your industry (AI? Python. Games? C#/C++). And practice—coding’s a muscle, not a talent.**&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>You Won't Believe How Easy It Is to Host Your Flutter App on Firebase for Free! ✨</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Fri, 17 May 2024 10:22:58 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/you-wont-believe-how-easy-it-is-to-host-your-flutter-app-on-firebase-for-free-3ni9</link>
      <guid>https://dev.to/humhaiabhinav/you-wont-believe-how-easy-it-is-to-host-your-flutter-app-on-firebase-for-free-3ni9</guid>
      <description>&lt;p&gt;🚀 In this short video, we're busting the myth that hosting a Flutter web app is complicated! 🌟 Prepare to be amazed as we show you how to deploy your Flutter creation to Firebase for free. 💸 Follow our step-by-step instructions and make the process a breeze. 🌀 So buckle up and learn how to get your app out to the world in no time! 🌍✨&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Implementing Firebase Background Notifications in Flutter 👌</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Fri, 10 May 2024 05:56:39 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/implementing-firebase-background-notifications-in-flutter-5di4</link>
      <guid>https://dev.to/humhaiabhinav/implementing-firebase-background-notifications-in-flutter-5di4</guid>
      <description>&lt;p&gt;&lt;strong&gt;Enabling Background Notifications in Your Flutter App with Firebase Cloud Messaging (FCM)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This guide walks you through implementing background notifications in your Flutter application using Firebase Cloud Messaging (FCM). FCM is a powerful service that allows you to send targeted and engaging notifications to your app users, even when the app is in the background or closed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Flutter project set up&lt;/li&gt;
&lt;li&gt;A Firebase project created (&lt;a href="https://console.firebase.google.com/" rel="noopener noreferrer"&gt;https://console.firebase.google.com/&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step-by-Step Guide:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Firebase Project Setup and Login:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Firebase console, create a new project or select an existing one.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;Project settings&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Your apps&lt;/strong&gt;..&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Activate FlutterFire CLI:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the FlutterFire CLI globally using the command:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt; dart pub global activate flutterfire_cli
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Configure FlutterFire:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In your project's root directory, run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt; flutterfire configure
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Select your Firebase project and choose the app(s) you want to enable notifications for.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Add Required Packages:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In your &lt;code&gt;pubspec.yaml&lt;/code&gt; file, add the following dependencies:
&lt;/li&gt;
&lt;/ul&gt;

&lt;pre class="highlight yaml"&gt;&lt;code&gt; &lt;span class="na"&gt;dependencies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="na"&gt;firebase_core&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
   &lt;span class="na"&gt;firebase_messaging&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;



&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;flutter pub get&lt;/code&gt; to install the packages.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Create Firebase Utilities Class (firebase_utils.dart):&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:firebase_messaging/firebase_messaging.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:logger/logger.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Consider using a logging library for debugging&lt;/span&gt;

   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;FirebaseUtil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;_firebaseMessaging&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FirebaseMessaging&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
     &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Logger&lt;/span&gt; &lt;span class="n"&gt;logger&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Logger&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Optional: For logging&lt;/span&gt;

     &lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;handleBackgroundMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;RemoteMessage&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;notification&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;title&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"No title available"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;notification&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;body&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;"No body available"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
       &lt;span class="c1"&gt;// Process the notification data here (e.g., display a local notification)&lt;/span&gt;
     &lt;span class="p"&gt;}&lt;/span&gt;

     &lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;initNotification&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
       &lt;span class="c1"&gt;// Request notification permissions&lt;/span&gt;
       &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_firebaseMessaging&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;requestPermission&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

       &lt;span class="c1"&gt;// Get the FCM token for identification&lt;/span&gt;
       &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;fCMToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_firebaseMessaging&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getToken&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
       &lt;span class="n"&gt;logger&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;d&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fCMToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

       &lt;span class="c1"&gt;// Listen for background messages&lt;/span&gt;
       &lt;span class="n"&gt;FirebaseMessaging&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;onBackgroundMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;handleBackgroundMessage&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;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initialize Notifications in main.dart:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:firebase_core/firebase_core.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter/material.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter_notification_test/firebase_options.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Replace with your project's path&lt;/span&gt;
   &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter_notification_test/firebase_utils.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

   &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="n"&gt;WidgetsFlutterBinding&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ensureInitialized&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
     &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Firebase&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initializeApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;options:&lt;/span&gt; &lt;span class="n"&gt;DefaultFirebaseOptions&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;currentPlatform&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

     &lt;span class="c1"&gt;// Initialize notification handling&lt;/span&gt;
     &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;FirebaseUtil&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initNotification&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

     &lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;

   &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyApp&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="n"&gt;StatelessWidget&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;

     &lt;span class="nd"&gt;@override&lt;/span&gt;
     &lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&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="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MaterialApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
         &lt;span class="nl"&gt;home:&lt;/span&gt; &lt;span class="n"&gt;Scaffold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
           &lt;span class="nl"&gt;body:&lt;/span&gt; &lt;span class="n"&gt;Center&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
             &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Background Notification Test"&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="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;&lt;strong&gt;Testing Notifications in Firebase Console:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the &lt;strong&gt;Engage &amp;gt;  Messaging&lt;/strong&gt; section in your Firebase project.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Send test message&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enter a title, body, and optionally, data for your notification.&lt;/li&gt;
&lt;li&gt;Paste the FCM token you obtained earlier (from &lt;code&gt;FirebaseUtil.initNotification&lt;/code&gt;) into the &lt;strong&gt;Device token&lt;/strong&gt; field. This token uniquely identifies your app instance.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Test&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&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%2F3044wdmsrshj6txmpjr7.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%2F3044wdmsrshj6txmpjr7.png" alt="Test Notification" width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;The code creates a &lt;code&gt;FirebaseUtil&lt;/code&gt; class to handle notification initialization and background message processing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;handleBackgroundMessage&lt;/code&gt; is called when a notification is received in the background. You can customize this function to display a local notification or perform other actions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;initNotification&lt;/code&gt; requests notification permissions, retrieves the FCM&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>flutter</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Building Your WordPress Dream Home on AWS EC2: A Step-by-Step Guide with Security in Mind 🎉</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Fri, 03 May 2024 07:14:57 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/building-your-wordpress-dream-home-on-aws-ec2-a-step-by-step-guide-with-security-in-mind-2d9k</link>
      <guid>https://dev.to/humhaiabhinav/building-your-wordpress-dream-home-on-aws-ec2-a-step-by-step-guide-with-security-in-mind-2d9k</guid>
      <description>&lt;h2&gt;
  
  
  Building Your WordPress Dream Home on AWS EC2: A Step-by-Step Guide with Security in Mind 🎉
&lt;/h2&gt;

&lt;p&gt;Have you ever dreamt of launching your WordPress site for free, without breaking the bank? Look no further than Amazon Web Services (AWS) EC2! It's like getting a free plot of prime digital land to build your online presence. Here's a 7-step walkthrough to be your friendly construction guide, complete with security measures:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Laying the Foundation (Dependencies)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First things first, we need to build the solid foundation for your website. Imagine these as the essential tools and materials you'll need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Installing Essential Components:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update -y  # Updates package lists
sudo apt install -y \
    php-dom php-simplexml php-ssh2 php-xml php-xmlreader \
    php-curl php-exif php-ftp php-gd php-iconv php-imagick \
    php-json php-mbstring php-posix php-sockets php-tokenizer \
    php-fpm php-mysql php-gmp php-intl php-cli nginx mysql-server
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;This command installs all the necessary software components, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  PHP: The architect, responsible for the website's functionality.&lt;/li&gt;
&lt;li&gt;  MySQL: The secure storage room for all your content (posts, pages, media).&lt;/li&gt;
&lt;li&gt;  Nginx: The friendly guard who welcomes visitors and efficiently delivers your content.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Bonus Security Tip:&lt;/strong&gt; We'll optimize MySQL for memory efficiency during a later step to ensure smooth performance.&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Creating Your Content Haven (MySQL Setup)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's design a secure storage space for all your amazing content. This is like a dedicated room in your website house:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Installing and Configuring MySQL Server:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl stop mysql.service  # Stops the MySQL service (optional)
&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Memory Optimization (Optional):&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To reduce memory usage for MySQL, you can edit the configuration file:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/mysql/mysql.cnf  # Opens the configuration file in Nano editor
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Add the following line at the top of the &lt;code&gt;[mysqld]&lt;/code&gt; section:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;performance_schema = 0  # Disables performance schema for memory savings
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Save the changes (Ctrl+O) and exit (Ctrl+X).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Starting the MySQL Service:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start mysql.service  # Starts the MySQL service
&lt;/code&gt;&lt;/pre&gt;

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


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Adding Tenants (MySQL User and Database)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the secure storage room ready, let's create a dedicated user to manage it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Setting Up User and Database for WordPress:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mysql  # Enters the MySQL terminal

CREATE DATABASE wp_apex;  # Creates a database named "wp_apex"
CREATE USER 'wp_admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourStrongPassword@123';  # Creates a user named "wp_admin" with a strong password
GRANT ALL PRIVILEGES ON wp_apex.* TO 'wp_admin'@'localhost' WITH GRANT OPTION;  # Grants the user full privileges on the database
FLUSH PRIVILEGES;  # Applies the changes

exit;  # Exits the MySQL terminal
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Security Reminder:&lt;/strong&gt; Replace &lt;code&gt;'YourStrongPassword@123'&lt;/code&gt; with a strong, unique password for enhanced security.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're absolutely right, my apologies! Here's the completed part 4 on configuring PHP, incorporating the missing explanations and security considerations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Fine-Tuning Your Architect (PHP Configuration)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, let's make sure PHP, the architect of your website, has the resources it needs to build and maintain your site efficiently. We'll adjust some settings and keep security in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configuring and Restarting PHP:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/php/8.1/fpm/php.ini  # Opens PHP configuration file (adjust path if version differs)
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Change the following parameters (adjust values as needed based on your website's expected traffic and content size):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;upload_max_filesize = 200M&lt;/code&gt; (maximum file upload size): This allows users to upload files up to 200MB in size. Adjust this based on your needs, but be mindful of potential security risks associated with very large uploads.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;post_max_size = 500M&lt;/code&gt; (maximum size of POST data): This sets the limit for form submissions. Again, adjust as needed while considering security implications.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;memory_limit = 512M&lt;/code&gt; (memory limit for PHP processes): This specifies the maximum amount of memory a single PHP script can use. Increase this if you anticipate resource-intensive plugins or themes.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;cgi.fix_pathinfo = 0&lt;/code&gt; (disables path information processing): This setting improves performance by disabling unnecessary processing.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;max_execution_time = 360&lt;/code&gt; (maximum execution time for scripts): This defines the longest a PHP script can run before being terminated. Adjust this cautiously, as overly long execution times can affect website responsiveness.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Use Ctrl+W in Nano to quickly find specific parameters within the file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Considerations:&lt;/strong&gt; While increasing resource limits can be beneficial for functionality, keep in mind that excessively high values can introduce security vulnerabilities. Carefully assess your website's requirements and strike a balance between performance and security.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Save the changes (Ctrl+O) and exit (Ctrl+X).&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Restart PHP to apply the new configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart php8.1-fpm.service  # Replace with the appropriate service name for your PHP version
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verify the restart:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status php8.1-fpm.service  # Replace with the appropriate service name for your PHP version
&lt;/code&gt;&lt;/pre&gt;

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


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;This step ensures PHP has the appropriate resources to handle your website's needs while keeping security in mind. Remember to adjust the provided values based on your specific website requirements.&lt;/p&gt;

&lt;p&gt;Here's the next part of the guide, incorporating the command breakdowns and security considerations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Moving In the Furniture (Downloading and Extracting WordPress)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that the foundation and storage are ready, it's time to bring in the essential elements for your website:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Downloading and Extracting WordPress:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd /var/www/  # Change directory to the web root
sudo wget https://wordpress.org/latest.tar.gz  # Downloads the latest WordPress archive
sudo tar -xvzf latest.tar.gz  # Extracts the archive
sudo chown -R www-data:www-data /var/www/wordpress  # Sets ownership to the web server user
sudo chmod -R 755 /var/www/wordpress  # Sets appropriate permissions for directories and files
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Security Reminder:&lt;/strong&gt; Downloading from the official WordPress source ensures authenticity and security.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Welcoming Visitors (Configuring Nginx)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We need a friendly doorman (Nginx) to greet visitors and direct them to your WordPress site:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Configure Nginx:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-enabled/wordpress  # Opens the Nginx configuration file for your WordPress site (adjust path if needed)
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Paste the following configuration, replacing &lt;code&gt;apexcreators.world&lt;/code&gt; with your actual domain name(s):&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
    listen 80;
    listen [::]:80;
    server_name apexcreators.world www.apexcreators.world;  # Adjust domain names
    root /var/www/wordpress;
    index  index.php index.html index.htm;
    access_log /var/log/nginx/wpress_access.log;
    error_log /var/log/nginx/wpress_error.log;

    client_max_body_size 100M;  # Maximum allowed body size for uploads
    autoindex off;
    location / {
        try_files $uri $uri/ /index.php?$args;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;  # Adjust path if PHP version differs
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Save the changes (Ctrl+O) and exit (Ctrl+X).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Testing and Restarting Nginx:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chmod 777 /etc/nginx/sites-enabled/wordpress  # Sets permissions temporarily (adjust later)
sudo nginx -t  # Tests the Nginx configuration for syntax errors
sudo service nginx restart  # Restarts Nginx to apply the changes
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;strong&gt;Security Note:&lt;/strong&gt; Change the permission of &lt;code&gt;/etc/nginx/sites-enabled/wordpress&lt;/code&gt; back to a more secure value (e.g., 644) after the test.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Adding an Extra Layer of Security (Installing and Configuring SSL)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's add an extra layer of security for your website and your visitors' data:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Installing Certbot:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo snap install core  # Installs the core snap
sudo snap refresh core  # Updates the core snap
sudo snap install --classic certbot  # Installs Certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot  # Creates a symbolic link for easier access
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Obtaining a Free SSL Certificate:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo certbot --nginx -d apexcreators.world -d www.apexcreators.world  # Replace with your domain names
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Follow the on-screen prompts to obtain a free SSL certificate from Let's Encrypt.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verifying Automatic Renewal:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status snap.certbot.renew.service  # Check if automatic renewal is enabled
sudo certbot renew --dry-run  # Test the certificate renewal process (optional)
&lt;/code&gt;&lt;/pre&gt;

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

&lt;p&gt;&lt;strong&gt;Congratulations! 🎉🎊&lt;/strong&gt; You've successfully set up your WordPress site on AWS EC2 with a strong foundation and security measures in place. Now you can visit your website domain name in a web browser to complete the WordPress installation and start creating content!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>wordpress</category>
      <category>php</category>
      <category>linux</category>
    </item>
    <item>
      <title>Deploy Your Node.js App in Minutes: Public IP + Nginx on Ubuntu ⚡</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Sun, 28 Apr 2024 10:17:52 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/deploy-your-nodejs-app-in-minutes-public-ip-nginx-on-ubuntu-18nn</link>
      <guid>https://dev.to/humhaiabhinav/deploy-your-nodejs-app-in-minutes-public-ip-nginx-on-ubuntu-18nn</guid>
      <description>&lt;p&gt;Hey there! Ready to get your Node.js app out into the wild using just your server’s public IP? Let’s walk through this step-by-step—no domain name required. Think of this as the "launch now, fancy domain later" approach. 😊&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What You’ll Need&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A Node.js app that’s ready to roll (already on your Ubuntu server).&lt;/li&gt;
&lt;li&gt;SSH access to your server (you’re probably already logged in!).&lt;/li&gt;
&lt;li&gt;Your server’s &lt;strong&gt;public IP address&lt;/strong&gt; (check your hosting provider’s dashboard if you’re unsure).&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;1. Prep Your Node.js App&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First, navigate to your app’s directory on the server. You know the drill:&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; /path/to/your/app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;2. Install PM2: Your App’s Bodyguard&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;PM2 keeps your app alive and kicking, even if it crashes. Install it globally with:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;3. Fire Up Your App with PM2&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Start your app and let PM2 manage it. Replace &lt;code&gt;app.js&lt;/code&gt; with your actual entry file (like &lt;code&gt;server.js&lt;/code&gt; or &lt;code&gt;index.js&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;pm2 start app.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your app runs in the background—no more panicking if you close the terminal!&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;4. Make PM2 Autostart (Because Reboots Happen)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Want your app to restart automatically if the server reboots? Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm2 startup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Follow the instructions it gives you&lt;/strong&gt;—this part is crucial! It usually involves copying/pasting a command it generates.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;5. Install Nginx (Your Traffic Director)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Nginx will act as a middleman, forwarding requests to your Node.js app. Install it:&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 update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;6. Configure Nginx to Route Traffic&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Time to tell Nginx where to send incoming requests. Let’s create a config file:&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;nano /etc/nginx/sites-available/your-app-name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Paste this configuration&lt;/strong&gt;, replacing &lt;code&gt;YOUR_PUBLIC_IP&lt;/code&gt; with your actual IP (and &lt;code&gt;3000&lt;/code&gt; with your app’s port if it’s different):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;YOUR_PUBLIC_IP&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;# Example: 123.123.123.123&lt;/span&gt;

  &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_pass&lt;/span&gt; &lt;span class="s"&gt;http://localhost:3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;# Your Node.js app's port&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_http_version&lt;/span&gt; &lt;span class="mf"&gt;1.1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Upgrade&lt;/span&gt; &lt;span class="nv"&gt;$http_upgrade&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Connection&lt;/span&gt; &lt;span class="s"&gt;'upgrade'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_set_header&lt;/span&gt; &lt;span class="s"&gt;Host&lt;/span&gt; &lt;span class="nv"&gt;$host&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;proxy_cache_bypass&lt;/span&gt; &lt;span class="nv"&gt;$http_upgrade&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;&lt;strong&gt;What’s happening here?&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nginx listens on port 80 (default HTTP port).
&lt;/li&gt;
&lt;li&gt;Requests to your IP get forwarded to your Node.js app running locally on port 3000.
&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;proxy_set_header&lt;/code&gt; lines ensure websockets and other features work smoothly.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;7. Test Your Nginx Config (Don’t Skip This!)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Typos happen. Validate your config with:&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;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you see &lt;code&gt;nginx: configuration is OK&lt;/code&gt;, you’re golden! If not, check for typos in the config file.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;8. Activate the Config &amp;amp; Reload Nginx&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Enable your new config by linking it:&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 ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/your-app-name /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reload Nginx to apply changes:&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;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  &lt;strong&gt;9. Open the Firewall Gate (If You Have One)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Using UFW? Unblock port 80 so traffic can flow:&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;ufw allow 80/tcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;(Skip this if you’re not using a firewall, but most cloud servers have one enabled by default.)&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;10. Celebrate! Test Your Live App&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Open your browser and visit &lt;code&gt;http://YOUR_PUBLIC_IP&lt;/code&gt;. If all went well, your app should be live! 🎉&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Troubleshooting Tips&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not working?&lt;/strong&gt; Double-check:

&lt;ul&gt;
&lt;li&gt;Your Node.js app is actually running (&lt;code&gt;pm2 list&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;The port in your Nginx config matches your app’s port.&lt;/li&gt;
&lt;li&gt;The firewall allows port 80 (&lt;code&gt;sudo ufw status&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Need to restart Nginx later? Use:
&lt;/li&gt;

&lt;/ul&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;systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;&lt;strong&gt;You did it!&lt;/strong&gt; Your app is now accessible to anyone with your server’s IP. When you’re ready to level up, consider adding a domain name and HTTPS (Let’s Encrypt is free!). But for now, bask in the glory of a live app. 🚀&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>node</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Host Wordpress Sites for Free on AWS EC2 in 5 Easy Steps</title>
      <dc:creator>Abhinav Kumar</dc:creator>
      <pubDate>Wed, 31 Jan 2024 20:46:41 +0000</pubDate>
      <link>https://dev.to/humhaiabhinav/how-to-host-wordpress-sites-for-free-on-aws-ec2-in-5-easy-steps-49en</link>
      <guid>https://dev.to/humhaiabhinav/how-to-host-wordpress-sites-for-free-on-aws-ec2-in-5-easy-steps-49en</guid>
      <description>&lt;h2&gt;
  
  
  Dreaming of launching your WordPress site without breaking the bank? Look no further than Amazon Web Services (AWS) EC2! This powerful platform offers a free tier that's perfect for hosting your WordPress site, empowering you to create a dynamic online presence without upfront costs. Ready to dive in? Here's a 5-step roadmap to guide you through the process:
&lt;/h2&gt;

&lt;p&gt;Step 1. Laying the Foundation: Dependencies and Server Setup&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Begin by installing the essential software components, including PHP, MySQL, and Nginx. These tools work together to power your WordPress site.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Optimize MySQL for memory efficiency to ensure smooth performance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 2. Creating a Database Home for Your Content&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Establish a MySQL database to store all your WordPress content, from posts and pages to media files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Assign a dedicated user with secure credentials to manage database interactions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 3. Fine-tuning PHP for WordPress Harmony&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configure PHP settings to align perfectly with WordPress requirements, ensuring optimal functionality and resource usage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Adjust parameters like upload limits, memory allocation, and execution time to suit your website's needs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 4. Welcoming WordPress to Your Server&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Download the latest WordPress files and extract them to the designated directory within your server.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Grant appropriate permissions to ensure seamless website operations.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 5. Empowering Nginx to Serve Your Content&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Configure Nginx, a high-performance web server, to handle incoming requests and deliver your WordPress content to visitors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Set up domain names, access logs, and error handling for a comprehensive web experience.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bonus Step: Securing Your Site with HTTPS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Install Certbot to obtain a free SSL/TLS certificate, enabling secure HTTPS connections and safeguarding user data.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify automatic certificate renewal to maintain website security effortlessly.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And to make things even easier, here's a video tutorial that explains the process in more detail.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Sy8zN318dv4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>hosting</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
