<?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>Forem: okayshankha</title>
    <description>The latest articles on Forem by okayshankha (@okayshankha).</description>
    <link>https://forem.com/okayshankha</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%2F595851%2F96fa4f82-bab7-4f64-baa4-62bb375a2411.jpeg</url>
      <title>Forem: okayshankha</title>
      <link>https://forem.com/okayshankha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/okayshankha"/>
    <language>en</language>
    <item>
      <title>Introducing Tracetrail - The API Debugging Tool You Need</title>
      <dc:creator>okayshankha</dc:creator>
      <pubDate>Fri, 28 Apr 2023 16:31:26 +0000</pubDate>
      <link>https://forem.com/okayshankha/introducing-tracetrail-the-api-debugging-tool-you-need-46af</link>
      <guid>https://forem.com/okayshankha/introducing-tracetrail-the-api-debugging-tool-you-need-46af</guid>
      <description>&lt;p&gt;Do you ever find yourself struggling to debug your API? Do you spend countless hours trying to locate issues and decipher payloads transferred between your client and server? If so, then you need Tracetrail - the API debugging tool that will change your life.&lt;/p&gt;

&lt;p&gt;Tracetrail is more than just an npm package. With Tracetrail, you can finally wave goodbye to the tedious task of debugging, regenerating error responses and say hello to a streamlined process that will leave you wondering how you ever managed without it.&lt;/p&gt;

&lt;p&gt;Tracetrail makes debugging simple by recording input and output payloads, allowing you to easily locate issues and get insights into your API's performance. Its user-friendly interface makes navigating through the recorded payloads a breeze, so you can spend less time searching for problems and more time building your application.&lt;/p&gt;

&lt;p&gt;To get started with Tracetrail, all you need to do is install the package using npm:&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;tracetrail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, you can start using Tracetrail in your project. Initialize it with the MongoDB database's URL to store the recorded payloads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { TraceTrail } from 'tracetrail'
import express from 'express'

const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the Tracetrail middleware to your Express application using the traceTrail.MiddleWare method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(traceTrail.MiddleWare)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that's it! Tracetrail will automatically start recording the payloads and make your debugging process a breeze.&lt;/p&gt;

&lt;p&gt;But wait, there's more! Tracetrail also comes with a built-in UI that allows you to view the recorded payloads easily. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--quGmKkeA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7mhqppa1tuip1dzm9m9.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--quGmKkeA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7mhqppa1tuip1dzm9m9.jpg" alt="Tracetrail UI" width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With just a few lines of code, you can add the Tracetrail UI to your application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use('/tracetrail', traceTrail.UI())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a new route in your application that will display the Tracetrail UI, so you can easily navigate through the recorded payloads and gain valuable insights into your API's performance.&lt;/p&gt;

&lt;p&gt;In conclusion, Tracetrail is not just another npm package; it's a superhero that will save you from the tedious task of debugging. With its simple installation, user-friendly interface, and built-in UI, Tracetrail is a must-have for any developer working with APIs. &lt;/p&gt;

&lt;p&gt;So what are you waiting for? Install Tracetrail today and say goodbye to your debugging woes!&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>You need a better solution for Cron Jobs</title>
      <dc:creator>okayshankha</dc:creator>
      <pubDate>Sun, 09 Oct 2022 19:06:50 +0000</pubDate>
      <link>https://forem.com/okayshankha/you-need-a-better-solution-for-cron-jobs-415e</link>
      <guid>https://forem.com/okayshankha/you-need-a-better-solution-for-cron-jobs-415e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ubyNqY0C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbhy1iqktrvapfllrbxm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ubyNqY0C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mbhy1iqktrvapfllrbxm.png" alt="Image description" width="880" height="738"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are coming from a technical background, the chances are, you have already used it or at least have heard of Cron Jobs. Even if you don’t have a technical background, no worries, I got you covered. I will be explaining the Cron Job concept briefly to you.&lt;/p&gt;

&lt;p&gt;In this article, we are going to discuss the traditional approach for Cron Jobs and what are the flaws of using it. So, without any further do, let’s get a brief understanding of what exactly Cron Job is.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Cron Job?
&lt;/h3&gt;

&lt;p&gt;A cron job is a program or script that runs automatically at certain times. The name comes from the Unix operating system, where it was originally developed. In Linux systems, cron jobs run every minute, hour, day, week, month, quarter, year, etc.&lt;/p&gt;

&lt;p&gt;When you schedule something to happen at a specific time, you want it to happen exactly then. That’s why you need a &lt;strong&gt;&lt;em&gt;cron job&lt;/em&gt;&lt;/strong&gt;. If you’re looking for ways to automate processes, you can create a cron job to execute a task. For example, you can schedule a backup to occur daily.&lt;/p&gt;

&lt;p&gt;I’m sorry if that was, a little overwhelming, but hopefully got the idea. Let’s have a quick overview first what is the traditional way to do it.&lt;/p&gt;

&lt;h3&gt;
  
  
  The traditional setup for Cron Jobs in Linux systems
&lt;/h3&gt;

&lt;p&gt;Well, the concept of Cron Jobs came from the Linux systems. They had this implementation to run a command at a specified time.&lt;/p&gt;

&lt;p&gt;We could access Cron Jobs via a Linux command called “&lt;strong&gt;crontab&lt;/strong&gt; “. There are some basic syntaxes to get started.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cron job syntaxes in Linux Systems
&lt;/h3&gt;

&lt;p&gt;Here I’m sharing some of the crontab commands to do things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;crontab -e&lt;/code&gt;: edits crontab entries to add, delete, or edit cron jobs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;crontab -l&lt;/code&gt;: list all the cron jobs for the current user.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;crontab -u username -l&lt;/code&gt;: ** ** list another user’s cron jobs.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;crontab -u username -e&lt;/code&gt;: ** ** edit another user’s cron jobs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to learn more about crontabs, check out this &lt;a href="https://www.freecodecamp.org/news/cron-jobs-in-linux/#:~:text=Cron%20is%20a%20job%20scheduling,other%20commands%20to%20run%20automatically."&gt;awesome article&lt;/a&gt; I found.&lt;/p&gt;

&lt;p&gt;Cron Jobs commands may vary from OS to OS. It means Linux-based systems have crontab but, what about Windows Systems? As a developer, you might not know where your application is going to be deployed! And depending on the OS you need to set up cron jobs every time. I think this is hard.&lt;/p&gt;

&lt;p&gt;Let’s assume, you are working on some project, say a NodeJS project, and you need to set up Cron Jobs for your application. What if, instead of you setting it up at the OS level, you could do the same in your NodeJS program itself?&lt;/p&gt;

&lt;p&gt;So, for that, if you do a quick Google search, it will come up with an NPM package called “ &lt;strong&gt;node-cron&lt;/strong&gt; “. Other programming languages have packages as well to implement in-code corn job setups.&lt;/p&gt;

&lt;p&gt;Continue reading the original post &lt;a href="https://devconcludes.com/you-need-a-better-solution-for-cron-jobs/"&gt;You need a better solution for Cron Jobs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>cronjobs</category>
    </item>
  </channel>
</rss>
