<?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: Shazin</title>
    <description>The latest articles on DEV Community by Shazin (@shazin).</description>
    <link>https://dev.to/shazin</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%2F658152%2F49d0133f-7341-49d2-83c9-1b327bc1518b.png</url>
      <title>DEV Community: Shazin</title>
      <link>https://dev.to/shazin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shazin"/>
    <language>en</language>
    <item>
      <title>I wrote a backend library for cloudflare worker and made it open source. Catch the full story.</title>
      <dc:creator>Shazin</dc:creator>
      <pubDate>Thu, 27 Nov 2025 18:01:21 +0000</pubDate>
      <link>https://dev.to/shazin/i-wrote-a-backend-library-for-cloudflare-worker-and-made-it-open-source-catch-the-full-story-1ie</link>
      <guid>https://dev.to/shazin/i-wrote-a-backend-library-for-cloudflare-worker-and-made-it-open-source-catch-the-full-story-1ie</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-story__hidden-navigation-link"&gt;Introducing Cloud Rover. Turn Cloudflare Workers into Fully Functional Backends.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/shazin" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F658152%2F49d0133f-7341-49d2-83c9-1b327bc1518b.png" alt="shazin profile" class="crayons-avatar__image" width="530" height="530"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/shazin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Shazin
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Shazin
                
              
              &lt;div id="story-author-preview-content-3065186" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/shazin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F658152%2F49d0133f-7341-49d2-83c9-1b327bc1518b.png" class="crayons-avatar__image" alt="" width="530" height="530"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Shazin&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 27 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" id="article-link-3065186"&gt;
          Introducing Cloud Rover. Turn Cloudflare Workers into Fully Functional Backends.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/serverless"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;serverless&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/javascript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;javascript&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cloud"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cloud&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;5&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>serverless</category>
      <category>javascript</category>
      <category>cloud</category>
    </item>
    <item>
      <title>I wrote a backend library for cloudflare worker and made it open source. Catch the full story.</title>
      <dc:creator>Shazin</dc:creator>
      <pubDate>Thu, 27 Nov 2025 17:35:56 +0000</pubDate>
      <link>https://dev.to/shazin/i-wrote-a-backend-library-for-cloudflare-worker-and-made-it-open-source-catch-the-full-story-3bfn</link>
      <guid>https://dev.to/shazin/i-wrote-a-backend-library-for-cloudflare-worker-and-made-it-open-source-catch-the-full-story-3bfn</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-story__hidden-navigation-link"&gt;Introducing Cloud Rover. Turn Cloudflare Workers into Fully Functional Backends.&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/shazin" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F658152%2F49d0133f-7341-49d2-83c9-1b327bc1518b.png" alt="shazin profile" class="crayons-avatar__image" width="530" height="530"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/shazin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Shazin
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Shazin
                
              
              &lt;div id="story-author-preview-content-3065186" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/shazin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F658152%2F49d0133f-7341-49d2-83c9-1b327bc1518b.png" class="crayons-avatar__image" alt="" width="530" height="530"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Shazin&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Nov 27 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" id="article-link-3065186"&gt;
          Introducing Cloud Rover. Turn Cloudflare Workers into Fully Functional Backends.
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/webdev"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;webdev&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/serverless"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;serverless&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/javascript"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;javascript&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/cloud"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;cloud&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;5&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            3 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>webdev</category>
      <category>serverless</category>
      <category>javascript</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Introducing Cloud Rover. Turn Cloudflare Workers into Fully Functional Backends.</title>
      <dc:creator>Shazin</dc:creator>
      <pubDate>Thu, 27 Nov 2025 17:27:42 +0000</pubDate>
      <link>https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j</link>
      <guid>https://dev.to/shazin/introducing-cloud-rover-turn-cloudflare-workers-into-fully-functional-backends-f9j</guid>
      <description>&lt;p&gt;Last year I was looking for serverless solutions for building apps without having to manage servers by myself. I knew about cloudflare worker befor. But never thought it is built for running we services or building api on it.  However upon using it I totally understood how it works. And thought all it needs is a routing system, proper request handling and some form of rules. That's all. &lt;/p&gt;

&lt;p&gt;For those of you who don't know what cloudflare worker is here's a short note from cloudflare docs&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A serverless platform for building, deploying, and scaling apps across Cloudflare's global network ↗ with a single command — no infrastructure to manage, no complex configuration&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I started working on a lightweight middleware library to simplify things on worker. Initially I created it for my personal usage, didn't have any intention for sharing in public. However, I don't know if any new library exists now, but I just feel like I should share this, if anyone finds it helpful that will be great for me. So basically it just adds a lightweight layer on top of the worker and provides the followings&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Easy routing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Request Handling:&lt;/strong&gt;  Process HTTP methods like GET, POST, and DELETE with built-in utilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured Response Management:&lt;/strong&gt; Respond with JSON, text, or HTML without repetitive code.&lt;/li&gt;
&lt;li&gt;Easy response handling (simplified from the original &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Response" rel="noopener noreferrer"&gt;Response&lt;/a&gt; Interface )&lt;/li&gt;
&lt;li&gt;Error handling&lt;/li&gt;
&lt;li&gt;And other miscellaneous things like CORS handling, different kind of routes like schematic routes,  standard handler function etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly it provides a standard structure which as of writing now by default cloudflare worker doesn't provide.  When you create a new worker you’ll see something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&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="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&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="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World!&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="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;And that's it from here you go full DIY mode. I created cloud-rover to simplify this process.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Rover
&lt;/h2&gt;

&lt;p&gt;Rover is a very simple thing. You create a cloudflare worker normally then you install the npm package &lt;code&gt;cloud-rover&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step-1
&lt;/h3&gt;

&lt;p&gt;So start by creating a new worker and installing &lt;code&gt;cloud-rover&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;&lt;span class="c"&gt;# create worker&lt;/span&gt;
npm create cloudflare@latest &lt;span class="nt"&gt;--&lt;/span&gt; my-first-worker
&lt;span class="nb"&gt;cd &lt;/span&gt;my-first-worker
&lt;span class="c"&gt;# install cloud-rover&lt;/span&gt;
npm &lt;span class="nb"&gt;install &lt;/span&gt;cloud-rover
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all you need as set-up.&lt;/p&gt;

&lt;p&gt;Details &lt;a href="https://rover.shazin.me/docs/getting-started/" rel="noopener noreferrer"&gt;Here&lt;/a&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Now go to the default  &lt;strong&gt;index.js/ts&lt;/strong&gt; file where you’ll see something similar I shared earlier.&lt;/p&gt;

&lt;p&gt;Now you need to define&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;A router using &lt;code&gt;createRouter&lt;/code&gt; method&lt;/li&gt;
&lt;li&gt;Define a handler&lt;/li&gt;
&lt;li&gt;Pass Rover as a response.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So instead of the default code provided by cloudflare we’ll use something like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight tsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createRouter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;RC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Rover&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;cloud-rover&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Define  a router&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Router&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;index_handler&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="c1"&gt;// the index handler function&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;index_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;rc&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;RC&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Hello World From Rover!&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="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="k"&gt;async&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Response&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nc"&gt;Rover&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;request&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;satisfies&lt;/span&gt; &lt;span class="nx"&gt;ExportedHandler&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Env&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all, you are now using cloud-rover. Just add more routes and functionalities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Consideration
&lt;/h2&gt;

&lt;p&gt;It might lack features and so does all softwares. I just added the  essentials, if you think you can make it better feel free to contribute. If you need any feature you can create a feature request too. I made this library for my own usage and it might face bugs, feel free to create issues on github. &lt;/p&gt;

&lt;h2&gt;
  
  
  Open Source and Contributions
&lt;/h2&gt;

&lt;p&gt;Like all meaningful tools, Rover is open source. It’s available on GitHub, and I’m excited to see how the developer community will use it to build amazing projects. Contributions, suggestions, and feedback are all welcome!&lt;/p&gt;

&lt;h2&gt;
  
  
  What’s Next?
&lt;/h2&gt;

&lt;p&gt;Check out the &lt;a href="https://rover.shazin.me" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; for detailed guides, API references, and more examples. Or head straight to &lt;a href="https://github.com/srshazin/cloud-rover" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; to explore the source code and get started. Or check out the &lt;a href="https://www.npmjs.com/package/cloud-rover" rel="noopener noreferrer"&gt;NPM Package&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Join the Journey
&lt;/h3&gt;

&lt;p&gt;If &lt;strong&gt;Cloud Rover&lt;/strong&gt; excites you as much as it excites me, consider starring the project on GitHub, sharing it with your network, or contributing code. Together, we can make Cloudflare Workers even more powerful.&lt;/p&gt;

&lt;p&gt;Let’s redefine serverless backend development. &lt;br&gt;
Thank you for reading.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>serverless</category>
      <category>javascript</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Screw it! I've Developed My Own Static Site Generator!</title>
      <dc:creator>Shazin</dc:creator>
      <pubDate>Thu, 15 Aug 2024 22:14:38 +0000</pubDate>
      <link>https://dev.to/shazin/screw-it-ive-developed-my-own-static-site-generator-27cd</link>
      <guid>https://dev.to/shazin/screw-it-ive-developed-my-own-static-site-generator-27cd</guid>
      <description>&lt;p&gt;Web development nowadays has become so complicated thanks to the creators of thousands of new ways to do the same thing. In the early days of web development he had PHP and jQuery which did pretty much everything we needed. But well things have changed now. &lt;/p&gt;

&lt;h2&gt;
  
  
  Long Story Short
&lt;/h2&gt;

&lt;p&gt;So, I was looking for a way to build my personal website. Which would have had some blogs and my project showcase that's it, no big deal right? Well, though the same thing as well. So, my initial thought was to use these as my tech stack&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React&lt;/li&gt;
&lt;li&gt;Firebase/Supabase&lt;/li&gt;
&lt;li&gt;Tailwind CSS&lt;/li&gt;
&lt;li&gt;Cloudflare Pages for deploying&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Well, this could be the happy ending but... 🙂&lt;/p&gt;

&lt;p&gt;As I've already stated I will need a blog section and ironically blogs and react doesn't go well together. Since React is basically for building WebApps not content driven websites. Now those who don't know why here's a summary from chatGPT&lt;/p&gt;

&lt;h2&gt;
  
  
  Why React is Not Suitable for Content Driven Sites
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;ChatGPT Said,&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;React is not ideal for content-driven sites primarily because it relies on client-side rendering, which can negatively impact SEO and initial page load times. Content-driven sites benefit from server-side rendering (SSR) or static site generation (SSG), which React doesn't handle out of the box. Tools like Next.js or Gatsby, which extend React, are better suited for these needs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Next Target: NextJs
&lt;/h2&gt;

&lt;p&gt;Well it's obvious that I need SSR for blog site since I wanted a good indexing by search engines and a professional social media link previews. NextJs could give me both of those, but there's still a problem, and it's kind of a personal one. &lt;/p&gt;

&lt;p&gt;See, I always loved using cloudflare pages and wanted to stick with that, besides I wanted cloudflare's free email routing to have a custom email address attached to my domain thus reducing the cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  NextJS at Cloudflare
&lt;/h3&gt;

&lt;p&gt;I tried deploying nextJS site to cloudflare pages via their official documentation. Well, things didn't go well. I wasn't able to deploy there I tried hours finding solution and nothing worked. Let's just say nextJS and cloudflare didn't go well together for me. So if anyone from Vercel or Cloudflare reading this correct me if I'm missing something.&lt;/p&gt;

&lt;p&gt;Well, at this point I was hopeless and the last option I had was &lt;strong&gt;SSG&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Next Solution: SSG
&lt;/h2&gt;

&lt;p&gt;Now SSG is good, and I understand the importance here. The problem is I've never worked with SSG before and there are multiple routes to through. There are things like Hugo, Gatsby, Astro blah blah. And probably more. Now I wasn't familiar with any of those and at this point I was so frustrated that I wasn't willing invest a bit on learning a new tool for a simple blog app. So I was like f*$k it I'll do my own thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating My Own Static Site Generator.
&lt;/h2&gt;

&lt;p&gt;Few points why I decided to develop my own static site generator&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I was frustrated (of course lol)&lt;/li&gt;
&lt;li&gt;Since I am making my own tool for my own thing, I will have the full control over how the pages will be generated. How will they look like.&lt;/li&gt;
&lt;li&gt;I like to reinvent.&lt;/li&gt;
&lt;li&gt;I had free times to spend.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Plan
&lt;/h2&gt;

&lt;p&gt;The plan was going old fashioned way of creating website. Separate articles will have their own html pages.&lt;/p&gt;

&lt;p&gt;Here's the full outline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I'll be writing on palin Markdown files&lt;/li&gt;
&lt;li&gt;Use python to parse the markdown into  plain HTML&lt;/li&gt;
&lt;li&gt;I will already have a template where different sections will be dynamically injected.&lt;/li&gt;
&lt;li&gt;Also I'll have a config file corresponding to the article. So the file hierarchy will kinda look like this
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;articles/
├── art-1
│   ├── art.md
│   └── config.json
├── art-2
│   ├── art.md
│   └── config.json
├── art-3
│   ├── art.md
│   └── config.json
└── art-4
    ├── art.md
    └── config.json

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

&lt;/div&gt;



&lt;p&gt;Hence, each post will have it's own folder and the folder will have the &lt;code&gt;config.json&lt;/code&gt; and &lt;code&gt;art.md&lt;/code&gt; , The python script will take the &lt;code&gt;template.html&lt;/code&gt; and insert dynamic contents to that HTML template, for instance the post title, slug, thumbnails from the config file and main article from the parsed markdown file. Most importantly it will dynamically generate meta tags for SEO and social medias.Afterwards, it will write the changes to a file called &lt;code&gt;art/&amp;lt;post-slug&amp;gt;.html&lt;/code&gt; so that the post link will be &lt;code&gt;example.com/art/slug&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How was it integrated?
&lt;/h2&gt;

&lt;p&gt;Well so I've developed a CLI interface for interacting with the generator. I've named it &lt;strong&gt;fit&lt;/strong&gt; you know as in &lt;strong&gt;F it&lt;/strong&gt;. It has the following commands or options:&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="nv"&gt;$ &lt;/span&gt;./fit &lt;span class="nt"&gt;--help&lt;/span&gt;
fit: also known has f&lt;span class="k"&gt;**&lt;/span&gt;k it build system
A build system &lt;span class="k"&gt;for &lt;/span&gt;my personal site developed by Shazin

USAGE
     fit &amp;lt;action&amp;gt; &amp;lt;argument&amp;gt;
COMMANDS
    init                Creates a new post template at articles/art-[n]
    build art-&amp;lt;n&amp;gt;       Builds the specified article
    &lt;span class="nb"&gt;sync                &lt;/span&gt;Syncs the global articles index to homepage
    uploader            Launches the GTK GUI image uploader
    upload &amp;lt;file_path&amp;gt;  Uploads the specified file to firebase
    deploy              Deploys &lt;span class="nb"&gt;local &lt;/span&gt;changes to remote repository
    &lt;span class="nb"&gt;help&lt;/span&gt;, &lt;span class="nt"&gt;-h&lt;/span&gt;, &lt;span class="nt"&gt;--help&lt;/span&gt;    Displays this &lt;span class="nb"&gt;help &lt;/span&gt;menu

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deployment mechanism
&lt;/h3&gt;

&lt;p&gt;So, like I said I wanted to use Cloudflare pages for deploying. Basically what I've done is I've created a branch called &lt;code&gt;prod&lt;/code&gt; and whenever the &lt;code&gt;./fit deploy&lt;/code&gt; command is run it will basically copy all the necessary files to the prod branch and push the changes to github. Then, cloudflare will automatically build and redeploy the changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Handing images
&lt;/h3&gt;

&lt;p&gt;In order to handle images or any static files I have used firebase storage, the &lt;code&gt;./fit uploader&lt;/code&gt; will pop open a GTK based GUI uploader from which I can upload an image and it will give me the public url which I can than copy, Here's how it looks:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload Interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2Fc988a419-4684-4f6f-ac0e-d06f3322da49.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%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2Fc988a419-4684-4f6f-ac0e-d06f3322da49.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Post Upload Interface&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2F83bb9517-00bc-4a37-a8b6-7b0659aa1227.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%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2F83bb9517-00bc-4a37-a8b6-7b0659aa1227.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  CLI Interface
&lt;/h4&gt;

&lt;p&gt;There's also  a CLI Interface which can be used by &lt;code&gt;./fit upload &amp;lt;filepath&lt;/code&gt; this was an option for cases where I don't have access to a GUI interface. This allows me to publish or edit articles from my phone as well using terminal emulator like Termux&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2F5a571151-32f6-4415-95fd-aa6b151832e3.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%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2F5a571151-32f6-4415-95fd-aa6b151832e3.png" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic Ambient Bcakground
&lt;/h3&gt;

&lt;p&gt;So, I thought when I am the one handling all the building and generation myself I can definitely do some cool stuffs with it, so I've added a dynamic colored ambient background to each post. The idea was to pick an average color from the thumbnail image and then darken it and use it as the background. I've also picked a primary color for the links and buttons from the thumbnail image as well and honestly to me, it looks really cool, here's an screenshot&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2Fd5d12272-43c6-40dd-8b75-aa58217c62e1.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%2Fstorage.googleapis.com%2Fshazin-me-data.appspot.com%2Fd5d12272-43c6-40dd-8b75-aa58217c62e1.png" alt="A post page sample" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Comments and Discussion
&lt;/h3&gt;

&lt;p&gt;Since I was working with basically no database or no backend service at all, I had to choose an external service for this and what else does this better than &lt;a href="https://disqus.com/" rel="noopener noreferrer"&gt;Disqus&lt;/a&gt; .&lt;/p&gt;

&lt;h2&gt;
  
  
  Was it Worth It?
&lt;/h2&gt;

&lt;p&gt;Well, to be honest like I said I was spending some free times, so yeah it was definitely worth it, and it didn't take me long time to be honest I've spent 2-3 days for this full project and really had fun building something creative.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;So, I've had really fun experience with this project and will hopefully do more improvements and add more functionalities to it. Right now it's so basic and simple which was what I wanted. If you like this project or want me to open source it please let me know. Oh and here's the link of the site I was screaming about &lt;a href="https://shazin.me" rel="noopener noreferrer"&gt;shazin.me&lt;/a&gt; Thanks for reading.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>python</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
