<?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: Kaibalya Kar</title>
    <description>The latest articles on DEV Community by Kaibalya Kar (@nerdincode).</description>
    <link>https://dev.to/nerdincode</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%2F2802206%2Fc7dfa468-4498-42c8-be10-b7d91444b136.jpeg</url>
      <title>DEV Community: Kaibalya Kar</title>
      <link>https://dev.to/nerdincode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nerdincode"/>
    <language>en</language>
    <item>
      <title>Debugging Stripe Webhooks in Node.js: The “Payload Must Be a String or Buffer” Error</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Fri, 22 Aug 2025 09:08:40 +0000</pubDate>
      <link>https://dev.to/nerdincode/debugging-stripe-webhooks-in-nodejs-the-payload-must-be-a-string-or-buffer-error-4a60</link>
      <guid>https://dev.to/nerdincode/debugging-stripe-webhooks-in-nodejs-the-payload-must-be-a-string-or-buffer-error-4a60</guid>
      <description>&lt;p&gt;When integrating Stripe into a Node.js application, webhooks play a critical role in handling real-time events like payments, subscriptions, and invoices. However, I recently ran into a tricky issue while verifying Stripe webhooks in my backend. The error looked something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;❌ Webhook signature verification failed: Webhook payload must be provided as a string or a Buffer instance representing the _raw_ request body. Payload was provided as a parsed JavaScript object instead.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At first glance, it seemed like a simple mismatch, but the root cause was a little deeper. Here’s how I solved it step by step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Problem&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stripe verifies webhooks by checking a signature against the raw request body. However, most Express apps use body parsers (express.json() or body-parser) which automatically parse the incoming JSON request into a JavaScript object.&lt;/p&gt;

&lt;p&gt;This means that by the time the request reaches Stripe’s constructEvent method, the raw body is no longer available, leading to the above error.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Fix&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The fix is to tell Express not to parse the body for Stripe webhook routes. Instead, we need the raw body as a Buffer.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import express from "express";
import Stripe from "stripe";
import bodyParser from "body-parser";

const app = express();
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY_TEST);

// ✅ Use raw body only for the webhook endpoint
app.post(
  "/webhook",
  bodyParser.raw({ type: "application/json" }),
  (req, res) =&amp;gt; {
    const sig = req.headers["stripe-signature"];
    let event;

    try {
      event = stripe.webhooks.constructEvent(
        req.body, // raw body (Buffer)
        sig,
        process.env.STRIPE_WEBHOOK_SECRET
      );
      console.log("✅ Webhook verified:", event.type);
    } catch (err) {
      console.error("❌ Webhook signature verification failed:", err.message);
      return res.sendStatus(400);
    }

    // Handle event
    if (event.type === "payment_intent.succeeded") {
      console.log("💰 Payment received!");
    }

    res.json({ received: true });
  }
);

// Normal JSON parsing for other routes
app.use(express.json());

app.listen(5000, () =&amp;gt; console.log("Server running on port 5000"));

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

&lt;/div&gt;



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

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Don’t parse Stripe webhook requests with express.json() or body-- parser.json().&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use bodyParser.raw({ type: "application/json" }) for the webhook route.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Always test your webhook integration using the Stripe CLI:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stripe listen --forward-to localhost:5000/webhook

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you see this error, it almost always means the body was already parsed into an object before reaching Stripe’s verifier.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Debugging this issue was a great reminder that not all requests should be parsed the same way. Stripe needs the original, untouched request body to verify signatures properly. Once I separated the raw body parsing logic only for the webhook endpoint, everything worked flawlessly.&lt;/p&gt;

&lt;p&gt;If you’re integrating Stripe into your Node.js backend and run into this error, just remember: webhooks need raw body, not JSON!&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>node</category>
      <category>help</category>
      <category>webdev</category>
    </item>
    <item>
      <title>🚀 How to Install Chromium for Puppeteer on AWS (EC2 or Lambda)</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Mon, 21 Jul 2025 20:43:04 +0000</pubDate>
      <link>https://dev.to/nerdincode/how-to-install-chromium-for-puppeteer-on-aws-ec2-or-lambda-3680</link>
      <guid>https://dev.to/nerdincode/how-to-install-chromium-for-puppeteer-on-aws-ec2-or-lambda-3680</guid>
      <description>&lt;p&gt;🧠 Why This Happens&lt;/p&gt;

&lt;p&gt;AWS environments (like Amazon Linux 2 on EC2 or Lambda) don’t come with Chromium installed by default. Also, the headless version Puppeteer tries to download is often incompatible with AWS's OS.&lt;/p&gt;

&lt;p&gt;To make Puppeteer work, you need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A compatible headless Chromium binary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proper dependencies installed (fonts, sandbox libs, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The right launch options.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🧠 Why This Happens&lt;/p&gt;

&lt;p&gt;AWS environments (like Amazon Linux 2 on EC2 or Lambda) don’t come with Chromium installed by default. Also, the headless version Puppeteer tries to download is often incompatible with AWS's OS.&lt;/p&gt;

&lt;p&gt;To make Puppeteer work, you need:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A compatible headless Chromium binary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Proper dependencies installed (fonts, sandbox libs, etc.).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The right launch options.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum update -y

# Install missing libraries
sudo yum install -y \
  atk.x86_64 \
  cups-libs.x86_64 \
  gtk3.x86_64 \
  libXcomposite.x86_64 \
  libXcursor.x86_64 \
  libXdamage.x86_64 \
  libXext.x86_64 \
  libXi.x86_64 \
  libXrandr.x86_64 \
  libXss.x86_64 \
  libXtst.x86_64 \
  pango.x86_64 \
  alsa-lib.x86_64 \
  ipa-gothic-fonts \
  xorg-x11-fonts-100dpi \
  xorg-x11-fonts-75dpi \
  xorg-x11-utils \
  xorg-x11-fonts-cyrillic \
  xorg-x11-fonts-Type1 \
  xorg-x11-fonts-misc \
  wget
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Step 2: Download a Compatible Chromium Binary&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~
mkdir chromium &amp;amp;&amp;amp; cd chromium

wget https://github.com/Sparticuz/chromium/releases/download/v123.0.0/chromium.br
# OR another known working build for Amazon Linux

# Decompress
brew install brotli # if needed
brotli --decompress chromium.br
chmod +x chromium

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

&lt;/div&gt;



&lt;p&gt;✅ Step 3: Point Puppeteer to This Chromium&lt;/p&gt;

&lt;p&gt;Now in your Node.js code:&lt;br&gt;
&lt;/p&gt;

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

const browser = await puppeteer.launch({
  executablePath: '/home/ec2-user/chromium/chromium',
  headless: true,
  args: [
    '--no-sandbox',
    '--disable-setuid-sandbox',
  ],
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;☁️ Bonus: Using Puppeteer with Chromium in AWS Lambda?&lt;/p&gt;

&lt;p&gt;Use chrome-aws-lambda:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install puppeteer-core chrome-aws-lambda

Then:

import chromium from 'chrome-aws-lambda';
import puppeteer from 'puppeteer-core';

export const handler = async () =&amp;gt; {
  const browser = await puppeteer.launch({
    args: chromium.args,
    defaultViewport: chromium.defaultViewport,
    executablePath: await chromium.executablePath,
    headless: chromium.headless,
  });

  const page = await browser.newPage();
  await page.goto('https://example.com');
  const screenshot = await page.screenshot();

  await browser.close();

  return screenshot;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🧪 Test It&lt;/p&gt;

&lt;p&gt;After setup:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;✅ If all goes well, Chromium should launch and Puppeteer will work as expected!&lt;/p&gt;




&lt;p&gt;✅ Summary&lt;/p&gt;

&lt;p&gt;Task Done&lt;/p&gt;

&lt;p&gt;Install system dependencies ✅&lt;br&gt;
Download compatible Chromium    ✅&lt;br&gt;
Launch Puppeteer with custom binary ✅&lt;/p&gt;

&lt;p&gt;Running Puppeteer on AWS isn’t plug and play and but once Chromium is correctly installed and referenced, everything runs smoothly.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Debugging Stripe Webhook Signature Verification Errors in Production</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Sun, 01 Jun 2025 13:28:51 +0000</pubDate>
      <link>https://dev.to/nerdincode/debugging-stripe-webhook-signature-verification-errors-in-production-1h7c</link>
      <guid>https://dev.to/nerdincode/debugging-stripe-webhook-signature-verification-errors-in-production-1h7c</guid>
      <description>&lt;p&gt;If you're integrating Stripe in a Node.js backend, you're likely using webhooks to handle events like &lt;strong&gt;checkout.session.completed&lt;/strong&gt;. One of the common pitfalls during deployment is related to webhook signature verification failures, and recently, I ran into exactly this issue.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk through the problem I faced, how I fixed it, and what best practices you can follow to avoid the same mistake.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post(
  "/api/v1/webhook/stripe",
  express.raw({ type: "application/json" }),
  stripeWebhookHandler
);

// JSON body parser for all other routes
app.use((req, res, next) =&amp;gt; {
  if (req.originalUrl === "/api/v1/webhook/stripe") {
    next(); // Skip body parsing for Stripe
  } else {
    express.json()(req, res, next);
  }
});

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

&lt;/div&gt;



&lt;p&gt;This is required because Stripe needs access to the raw body to verify the signature using the stripe.webhooks.constructEvent() method.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

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

&lt;p&gt;**&lt;br&gt;
After deploying to production, Stripe kept returning this error:&lt;/p&gt;

&lt;p&gt;❗ "Webhook signature verification failed. No signatures found matching the expected signature for payload."&lt;/p&gt;

&lt;p&gt;I was sure my raw body handling was correct, and the endpoint URL was accurate. Locally, everything worked using the Stripe CLI. But in production… webhook requests kept failing.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔍 The Root Cause
&lt;/h2&gt;

&lt;p&gt;Turns out the issue was very simple but easy to overlook:&lt;br&gt;
👉 I was using the Test Mode webhook signing secret (whsec_...) in production, while Stripe was sending Live Mode events.&lt;/p&gt;

&lt;p&gt;Stripe signs test and live events with different secrets, and if you mismatch them, signature verification will always fail — even if your code is perfect.&lt;/p&gt;

&lt;p&gt;✅ The Fix: Environment-Based Configuration&lt;br&gt;
To avoid this, I updated my environment variables and Stripe initialization code to handle different modes based on the environment&lt;/p&gt;

&lt;p&gt;🧪 Bonus Tip: Use Stripe CLI for Local Testing&lt;/p&gt;

&lt;h2&gt;
  
  
  To test webhooks locally with the Stripe CLI:
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stripe login
stripe listen --forward-to localhost:5000/api/v1/webhook/stripe
stripe trigger checkout.session.completed

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

&lt;/div&gt;



&lt;p&gt;Make sure your local environment uses the test mode secrets to match the CLI’s default behavior.&lt;/p&gt;

&lt;p&gt;💡 Final Thoughts&lt;br&gt;
Small mistakes like using the wrong webhook secret can cost you hours of debugging. If you're getting a "Webhook signature verification failed" error, double-check your mode (test/live) and environment configuration.&lt;/p&gt;

&lt;p&gt;If this helped you, share it with someone struggling with Stripe setup — and happy coding! ⚡&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>ci</category>
      <category>node</category>
      <category>programming</category>
    </item>
    <item>
      <title>Deploy Your First Node.js App on AWS EC2 Without NGINX (Beginner Friendly) EC2 without using NGINX —💻🔥🚀</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Sun, 01 Jun 2025 13:23:07 +0000</pubDate>
      <link>https://dev.to/nerdincode/deploy-your-first-nodejs-app-on-aws-ec2-without-nginx-beginner-friendly-ec2-without-using-nginx-2b5f</link>
      <guid>https://dev.to/nerdincode/deploy-your-first-nodejs-app-on-aws-ec2-without-nginx-beginner-friendly-ec2-without-using-nginx-2b5f</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;🧠 Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AWS account&lt;/p&gt;

&lt;p&gt;Basic Node.js knowledge&lt;/p&gt;

&lt;p&gt;Terminal and VS Code installed&lt;/p&gt;

&lt;p&gt;GitHub account (for code upload)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## 🪄 Step 1: Create EC2 Instance&lt;/strong&gt;&lt;br&gt;
Go to AWS EC2 Dashboard → Launch Instance&lt;/p&gt;

&lt;p&gt;Choose Ubuntu (20.04 preferred)&lt;/p&gt;

&lt;p&gt;Instance type: t2.micro (free tier)&lt;/p&gt;

&lt;p&gt;Key pair: Create or download .pem file (e.g., my-webserver-kp.pem)&lt;/p&gt;

&lt;p&gt;In Security Group, allow inbound rule for:&lt;/p&gt;

&lt;p&gt;SSH (22)&lt;/p&gt;

&lt;p&gt;HTTP (80)&lt;/p&gt;

&lt;p&gt;Custom TCP (3000)&lt;/p&gt;

&lt;p&gt;Launch the instance&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🌐 Step 2: Allocate Elastic IP&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Go to EC2 → Elastic IP → Allocate&lt;/p&gt;

&lt;p&gt;Associate Elastic IP with your instance&lt;/p&gt;

&lt;p&gt;✅ This gives your server a permanent IP address&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## 🔐 Step 3: Connect to EC2 via SSH (Windows)&lt;/strong&gt;&lt;br&gt;
Open Git Bash or terminal&lt;/p&gt;

&lt;p&gt;Go to .pem file location:&lt;br&gt;
cd /Downloads&lt;br&gt;
Set permission (Linux/macOS only):&lt;/p&gt;

&lt;p&gt;chmod 400 my-webserver-kp.pem//your key pair name&lt;br&gt;
Connect to EC2:&lt;/p&gt;

&lt;p&gt;ssh -i "my-webserver-kp.pem" ubuntu@&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## ⚙️ Step 4: Setup Node.js &amp;amp; Git&lt;/strong&gt;&lt;br&gt;
Inside EC2 terminal:&lt;br&gt;
sudo apt update&lt;br&gt;
sudo apt install nodejs npm git -y&lt;br&gt;
node -v&lt;br&gt;
npm -v&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;## 📦 Step 5: Clone Your Project&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;https://github.com/&lt;/a&gt;/.git&lt;br&gt;
cd &lt;br&gt;
npm install&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🚀 Step 6: Run Your App with PM2&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Install PM2:&lt;/p&gt;

&lt;p&gt;sudo npm install -g pm2&lt;br&gt;
Run your server:&lt;/p&gt;

&lt;p&gt;pm2 start index.js&lt;/p&gt;

&lt;p&gt;pm2 reload all&lt;/p&gt;

&lt;p&gt;pm2 status&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🧪 Step 7: Visit Your App&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open browser and visit:&lt;/p&gt;

&lt;p&gt;http://:3000&lt;br&gt;
Congrats 🎉 You’ve got your app live on the internet!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
You’ve just deployed a backend server to AWS EC2 without needing Docker, NGINX, or complex CI/CD. It’s raw, simple, and effective — perfect for learning and practice.&lt;/p&gt;

&lt;p&gt;Next Steps:&lt;/p&gt;

&lt;p&gt;Use NGINX to run on port 80/443 (for domain &amp;amp; SSL)&lt;/p&gt;

&lt;p&gt;Add MongoDB with Atlas&lt;/p&gt;

&lt;p&gt;Deploy frontend (React/Vite) using S3 or EC2 + NGINX&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Deploy Your First Node.js App on AWS EC2 Without NGINX (Beginner Friendly) EC2 without using NGINX —💻🔥🚀</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Fri, 11 Apr 2025 13:32:52 +0000</pubDate>
      <link>https://dev.to/nerdincode/deploy-your-first-nodejs-app-on-aws-ec2-without-nginx-beginner-friendly-ec2-without-using-nginx-2iko</link>
      <guid>https://dev.to/nerdincode/deploy-your-first-nodejs-app-on-aws-ec2-without-nginx-beginner-friendly-ec2-without-using-nginx-2iko</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;🧠 Prerequisites&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;AWS account&lt;/p&gt;

&lt;p&gt;Basic Node.js knowledge&lt;/p&gt;

&lt;p&gt;Terminal and VS Code installed&lt;/p&gt;

&lt;p&gt;GitHub account (for code upload)&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🪄 Step 1: Create EC2 Instance&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Go to AWS EC2 Dashboard → Launch Instance&lt;/p&gt;

&lt;p&gt;Choose Ubuntu (20.04 preferred)&lt;/p&gt;

&lt;p&gt;Instance type: t2.micro (free tier)&lt;/p&gt;

&lt;p&gt;Key pair: Create or download .pem file (e.g., my-webserver-kp.pem)&lt;/p&gt;

&lt;p&gt;In Security Group, allow inbound rule for:&lt;/p&gt;

&lt;p&gt;SSH (22)&lt;/p&gt;

&lt;p&gt;HTTP (80)&lt;/p&gt;

&lt;p&gt;Custom TCP (3000)&lt;/p&gt;

&lt;p&gt;Launch the instance&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🌐 Step 2: Allocate Elastic IP&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Go to EC2 → Elastic IP → Allocate&lt;/p&gt;

&lt;p&gt;Associate Elastic IP with your instance&lt;/p&gt;

&lt;p&gt;✅ This gives your server a permanent IP address&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🔐 Step 3: Connect to EC2 via SSH (Windows)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open Git Bash or terminal&lt;/p&gt;

&lt;p&gt;Go to .pem file location:&lt;br&gt;
cd /Downloads&lt;br&gt;
Set permission (Linux/macOS only):&lt;/p&gt;

&lt;p&gt;chmod 400 my-webserver-kp.pem//your key pair name&lt;br&gt;
Connect to EC2:&lt;/p&gt;

&lt;p&gt;ssh -i "my-webserver-kp.pem" ubuntu@&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 4: Setup Node.js &amp;amp; Git&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Inside EC2 terminal:&lt;br&gt;
sudo apt update&lt;br&gt;
sudo apt install nodejs npm git -y&lt;br&gt;
node -v&lt;br&gt;
npm -v&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;📦 Step 5: Clone Your Project&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;https://github.com/&lt;/a&gt;/.git&lt;br&gt;
cd &lt;br&gt;
npm install&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🚀 Step 6: Run Your App with PM2&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Install PM2:&lt;/p&gt;

&lt;p&gt;sudo npm install -g pm2&lt;br&gt;
Run your server:&lt;/p&gt;

&lt;p&gt;pm2 start index.js&lt;/p&gt;

&lt;p&gt;pm2 reload all&lt;/p&gt;

&lt;p&gt;pm2 status&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;🧪 Step 7: Visit Your App&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Open browser and visit:&lt;/p&gt;

&lt;p&gt;http://:3000&lt;br&gt;
Congrats 🎉 You’ve got your app live on the internet!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
You’ve just deployed a backend server to AWS EC2 without needing Docker, NGINX, or complex CI/CD. It’s raw, simple, and effective — perfect for learning and practice.&lt;/p&gt;

&lt;p&gt;Next Steps:&lt;/p&gt;

&lt;p&gt;Use NGINX to run on port 80/443 (for domain &amp;amp; SSL)&lt;/p&gt;

&lt;p&gt;Add MongoDB with Atlas&lt;/p&gt;

&lt;p&gt;Deploy frontend (React/Vite) using S3 or EC2 + NGINX&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>linux</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why Developers Should Use Elastic IP on AWS (And How to Do It)🚀</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Wed, 09 Apr 2025 16:16:35 +0000</pubDate>
      <link>https://dev.to/nerdincode/why-developers-should-use-elastic-ip-on-aws-and-how-to-do-it-3bdk</link>
      <guid>https://dev.to/nerdincode/why-developers-should-use-elastic-ip-on-aws-and-how-to-do-it-3bdk</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;What is an Elastic IP?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;An Elastic IP (EIP) is a static IPv4 address provided by AWS. Once you allocate it and bind it to your EC2 instance, it remains constant — no matter how many times you stop, reboot, or restart the instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;✅ Why Should Developers Use Elastic IP?&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Your IP Never Changes&lt;/strong&gt;
Without Elastic IP:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You get a new public IP every time your EC2 instance restarts.&lt;/p&gt;

&lt;p&gt;You have to update your frontend, Postman, or any API integrations over and over.&lt;/p&gt;

&lt;p&gt;With Elastic IP:&lt;/p&gt;

&lt;p&gt;Your server gets a permanent public IP. Clean and hassle-free.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;⚙️ How to Allocate and Use Elastic IP&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Here’s a step-by-step guide:&lt;/p&gt;

&lt;p&gt;Go to your EC2 Dashboard.&lt;/p&gt;

&lt;p&gt;In the left menu, click Elastic IPs.&lt;/p&gt;

&lt;p&gt;Click Allocate Elastic IP address.&lt;/p&gt;

&lt;p&gt;Choose “Amazon’s pool of IPv4 addresses”, then click Allocate.&lt;/p&gt;

&lt;p&gt;After allocation, select the new IP → click Actions &amp;gt; Associate Elastic IP.&lt;/p&gt;

&lt;p&gt;Choose your running EC2 instance and confirm.&lt;/p&gt;

&lt;p&gt;That’s it! 🎉 Your EC2 instance now has a fixed public IP.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;⚠️ Warning: Unused Elastic IPs Can Cost You!&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Elastic IPs are free — but only if they’re in use.&lt;/p&gt;

&lt;p&gt;If you allocate an Elastic IP and don’t associate it with a running EC2 instance, AWS will charge you a small hourly fee.&lt;/p&gt;

&lt;p&gt;💡 Pro Tip:&lt;br&gt;
When you're done using it:&lt;/p&gt;

&lt;p&gt;Go to Elastic IPs&lt;/p&gt;

&lt;p&gt;Select it&lt;/p&gt;

&lt;p&gt;Click Actions → Release Elastic IP&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Elastic IP is a small step that makes a huge difference in dev workflows. It's simple, efficient, and keeps your deployments smooth.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>Solving the "Could Not Determine Executable to Run" Error When Initializing Tailwind CSS</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Tue, 25 Mar 2025 12:00:28 +0000</pubDate>
      <link>https://dev.to/nerdincode/solving-the-could-not-determine-executable-to-run-error-when-initializing-tailwind-css-1i99</link>
      <guid>https://dev.to/nerdincode/solving-the-could-not-determine-executable-to-run-error-when-initializing-tailwind-css-1i99</guid>
      <description>&lt;p&gt;If you've recently tried setting up Tailwind CSS in your project using npx tailwindcss init -p and encountered the frustrating "could not determine executable to run" error, you're not alone. This common issue stems from recent changes in Tailwind CSS v4, and I'll walk you through exactly how to resolve it.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding the Problem
&lt;/h2&gt;

&lt;p&gt;**&lt;br&gt;
When you run: &lt;strong&gt;npx tailwindcss init -p&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You might see: &lt;strong&gt;npm ERR! could not determine executable to run&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This occurs because:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tailwind CSS v4 removed the init command from its CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The default installation now grabs v4, which doesn't support the traditional initialization&lt;/p&gt;

&lt;p&gt;The executable path isn't being properly resolved&lt;/p&gt;

&lt;p&gt;The Solution: Use Tailwind CSS v3 (Recommended for Most Projects)&lt;br&gt;
If you want to keep using the familiar initialization command:&lt;/p&gt;

&lt;h1&gt;
  
  
  Install specific v3 versions
&lt;/h1&gt;

&lt;p&gt;npm install -D tailwindcss@3 postcss autoprefixer&lt;/p&gt;

&lt;h1&gt;
  
  
  Initialize configuration
&lt;/h1&gt;

&lt;p&gt;npx tailwindcss init -p&lt;/p&gt;

&lt;p&gt;Maintain compatibility with existing setups&lt;/p&gt;

&lt;p&gt;ThankYou 😉✌️&lt;/p&gt;

</description>
      <category>tailwindcss</category>
      <category>webdev</category>
      <category>frontend</category>
      <category>npm</category>
    </item>
    <item>
      <title>How to Fix "Failed to Load PDF Document" Error on Cloudinary or</title>
      <dc:creator>Kaibalya Kar</dc:creator>
      <pubDate>Sat, 01 Feb 2025 18:26:20 +0000</pubDate>
      <link>https://dev.to/nerdincode/how-to-fix-failed-to-load-pdf-document-error-on-cloudinary-or-52il</link>
      <guid>https://dev.to/nerdincode/how-to-fix-failed-to-load-pdf-document-error-on-cloudinary-or-52il</guid>
      <description>&lt;h1&gt;
  
  
  &lt;strong&gt;How to Resolve "PDF Files Can’t Be Shared Externally" in Cloudinary&lt;/strong&gt;
&lt;/h1&gt;

&lt;p&gt;If you’re using Cloudinary to upload and share PDF files, you may have run into the annoying error: "PDF files can’t be shared externally." This can be particularly frustrating when you’ve uploaded a PDF and expect to share it publicly, but Cloudinary blocks access by default.&lt;/p&gt;

&lt;p&gt;In this post, I’ll walk you through why this happens and how to resolve it step-by-step, so you can successfully share PDF files externally without any hiccups.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Why Does This Happen?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Cloudinary, by default, restricts the delivery of certain file types (like PDFs and ZIP files) for security reasons. This means even if you upload a PDF and get a URL, it won’t be accessible unless you explicitly allow PDF file delivery in your Cloudinary settings. Additionally, the file must be marked as &lt;em&gt;public&lt;/em&gt; for it to be accessible via its URL.&lt;/p&gt;

&lt;p&gt;Let’s dive into the solution.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Step-by-Step Solution&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Enable PDF File Delivery in Cloudinary&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;First, let’s make sure that Cloudinary is set to allow PDF file delivery:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Log in to Cloudinary&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Go to &lt;a href="https://cloudinary.com/" rel="noopener noreferrer"&gt;Cloudinary&lt;/a&gt; and log in to your account.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Go to Security Settings&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Click on the Settings icon (gear icon) located at the top-right corner of the Cloudinary dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scroll to the Security Section&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Scroll down until you find the &lt;em&gt;Security&lt;/em&gt; section.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Allow PDF and ZIP File Delivery&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Look for the option labeled &lt;em&gt;PDF and ZIP files delivery&lt;/em&gt;. Toggle the switch to &lt;em&gt;Allow delivery of PDF and ZIP files&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Click Save&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
After enabling the setting, be sure to click &lt;em&gt;Save&lt;/em&gt; to apply the changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will allow Cloudinary to serve PDF files from URLs.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;2. Ensure the File is Public&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Even after enabling PDF delivery, your file needs to be marked as public to be accessible.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Check the File in Cloudinary Dashboard&lt;/strong&gt;
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Go to the &lt;strong&gt;Media Library&lt;/strong&gt; in your Cloudinary dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Find the PDF file you uploaded (e.g., &lt;code&gt;resumes/nxx0wzdvdsonnuxgenif.pdf&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ensure the File is Public&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Confirm that the file is set to &lt;em&gt;Public&lt;/em&gt;. If it’s not, you won’t be able to access it through its URL.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Update the Access Mode During Upload&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;If you’re uploading the file programmatically, you need to ensure that it’s set as public. For example, when uploading a file via JavaScript, add the &lt;code&gt;access_mode: "public"&lt;/code&gt; parameter:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
const cloudResponse = await cloudinary.uploader.upload(fileUri.content, {
  resource_type: "raw", // Treat PDF as a raw file
  access_mode: "public", // Make the file publicly accessible
  folder: "resumes",
});

#### **Conclusion**
The "PDF files can’t be shared externally" error on Cloudinary is a common but easily solvable issue. By enabling PDF file delivery in your Cloudinary settings and ensuring your files are marked as public, you can quickly resolve this problem. If you’re still facing issues, double-check your frontend code and consider using an embedded PDF viewer.

I hope this guide saves you the two days I spent debugging this issue. Happy coding! 🚀
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>cloudinary</category>
      <category>node</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
