<?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: Anand Chowdhary</title>
    <description>The latest articles on DEV Community by Anand Chowdhary (@anandchowdhary).</description>
    <link>https://dev.to/anandchowdhary</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%2F202266%2Fd5066d16-5f45-4c79-aed2-2ce0060b1ac6.jpg</url>
      <title>DEV Community: Anand Chowdhary</title>
      <link>https://dev.to/anandchowdhary</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anandchowdhary"/>
    <language>en</language>
    <item>
      <title>Upptime: Unlimited, free and open source uptime monitor, powered by GitHub Actions</title>
      <dc:creator>Anand Chowdhary</dc:creator>
      <pubDate>Sun, 16 Aug 2020 12:42:17 +0000</pubDate>
      <link>https://dev.to/anandchowdhary/upptime-unlimited-free-and-open-source-uptime-monitor-powered-by-github-actions-20ii</link>
      <guid>https://dev.to/anandchowdhary/upptime-unlimited-free-and-open-source-uptime-monitor-powered-by-github-actions-20ii</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VJmqLxJv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/63wvl44ajo7kf6a4obwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VJmqLxJv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/63wvl44ajo7kf6a4obwg.png" alt="Screenshot of status page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;GitHub Actions is used as an uptime monitor

&lt;ul&gt;
&lt;li&gt;Every 5 minutes, a workflow visits your website to make sure it's up&lt;/li&gt;
&lt;li&gt;Response time is recorded every 6 hours and committed to git&lt;/li&gt;
&lt;li&gt;Graphs of response time are generated every day&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;GitHub Issues are used for incident reports

&lt;ul&gt;
&lt;li&gt;An issue is opened if an endpoint is down&lt;/li&gt;
&lt;li&gt;People from your team are assigned to the issue&lt;/li&gt;
&lt;li&gt;Incidents reports are posted as issue comments&lt;/li&gt;
&lt;li&gt;Issues are locked so non-members cannot comment on them&lt;/li&gt;
&lt;li&gt;Issues are closed automatically when your site comes back up&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;GitHub Pages are used for the status website

&lt;ul&gt;
&lt;li&gt;A simple, beautiful, and accessible PWA is generated&lt;/li&gt;
&lt;li&gt;Built with Svelte and Sapper&lt;/li&gt;
&lt;li&gt;Fetches data from this repository using the GitHub API&lt;/li&gt;
&lt;/ul&gt;


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

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments&lt;/p&gt;

&lt;h3&gt;
  
  
  Yaml File or Link to Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/koj-co/upptime"&gt;https://github.com/koj-co/upptime&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Concepts
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Issues as incidents
&lt;/h4&gt;

&lt;p&gt;When the GitHub Actions workflow detects that one of your URLs is down, it automatically opens a GitHub issue (&lt;a href="https://github.com/koj-co/upptime/issues/15"&gt;example issue #15&lt;/a&gt;). You can add incident reports to this issue by adding comments. When your site comes back up, the issue will be closed automatically as well.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;img alt="Screenshot of GitHub issue" src="https://res.cloudinary.com/practicaldev/image/fetch/s--sjh1JVlx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/koj-co/upptime/master/assets/screenshot-issue.png"&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img alt="Screenshot of incident page" src="https://res.cloudinary.com/practicaldev/image/fetch/s--2z7in9Sv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/koj-co/upptime/master/assets/screenshot-incident.png"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Commits for response time
&lt;/h4&gt;

&lt;p&gt;Four times per day, another workflow runs and records the response time of your websites. This data is commited to GitHub, so it's available in the commit history of each file (&lt;a href="https://github.com/koj-co/upptime/commits/master/history/wikipedia.yml"&gt;example commit history&lt;/a&gt;). Then, the GitHub API is used to graph the response time history of each endpoint and to track when a site went down.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
      &lt;img alt="Screenshot of GitHub commits" src="https://res.cloudinary.com/practicaldev/image/fetch/s--EhEFGGiB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/koj-co/upptime/master/assets/screenshot-history.png"&gt;
    &lt;/td&gt;
    &lt;td&gt;
      &lt;img alt="Screenshot of live status" src="https://res.cloudinary.com/practicaldev/image/fetch/s---TIvxRBW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/koj-co/upptime/master/assets/screenshot-live-status.png"&gt;
    &lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

</description>
      <category>actionshackathon</category>
    </item>
    <item>
      <title>Run a remote Node.js file quickly</title>
      <dc:creator>Anand Chowdhary</dc:creator>
      <pubDate>Wed, 18 Mar 2020 21:31:12 +0000</pubDate>
      <link>https://dev.to/anandchowdhary/run-a-remote-node-js-file-quickly-27hh</link>
      <guid>https://dev.to/anandchowdhary/run-a-remote-node-js-file-quickly-27hh</guid>
      <description>&lt;p&gt;If you have a local Node.js file that does something, it's very easy to run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;node path/to/file.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;However, if you have a remote file on a URL, say &lt;a href="https://example.com/script.js"&gt;https://example.com/script.js&lt;/a&gt;, you have several steps before you can get your desired output in your terminal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download script.js (using &lt;code&gt;curl&lt;/code&gt;, for example) to a directory&lt;/li&gt;
&lt;li&gt;Create a &lt;code&gt;package.json&lt;/code&gt; file to make sure it runs&lt;/li&gt;
&lt;li&gt;Check if it has any external dependencies&lt;/li&gt;
&lt;li&gt;Install external dependencies (using &lt;code&gt;npm install&lt;/code&gt;, for example)&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;node script.js&lt;/code&gt; to execute it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is too much of work, especially if you want to get started quickly. So, introducing &lt;a href="https://github.com/AnandChowdhary/run-url"&gt;&lt;strong&gt;run-url&lt;/strong&gt;&lt;/a&gt;: an open-source npm remote URL runner written in TypeScript.&lt;/p&gt;

&lt;p&gt;Now, you can just run the URL using &lt;code&gt;npx&lt;/code&gt;, just like you're used to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npx run-url https://example.com/script.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can also install &lt;code&gt;run-url&lt;/code&gt; globally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="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;--global&lt;/span&gt; run-url
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And it'll be available in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;run-url https://example.com/script.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h2&gt;
  
  
  Running GitHub Gists with Node.js
&lt;/h2&gt;

&lt;p&gt;If you quickly want to prototype, a great way is to create a GitHub Gist. For example, I have the following: &lt;a href="https://gist.github.com/AnandChowdhary/3c0400b29a18a2afff7a23e2a3308c22#file-log-moment-js"&gt;https://gist.github.com/AnandChowdhary/3c0400b29a18a2afff7a23e2a3308c22#file-log-moment-js&lt;/a&gt;, which has a dependency (&lt;code&gt;moment&lt;/code&gt;) and outputs the current date.&lt;/p&gt;

&lt;p&gt;Simply copy the raw URL of the gist file and run it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;npx run-url https://gist.githubusercontent.com/AnandChowdhary/3c0400b29a18a2afff7a23e2a3308c22/raw/8ab3ca87821511e580d72585c72736b833d18697/log-moment.js
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;code&gt;run-url&lt;/code&gt; will install the required dependency (in this case, &lt;code&gt;moment&lt;/code&gt;) in a temporary folder, run the Node.js file, and then remove the temporary folder. Just like &lt;code&gt;npx&lt;/code&gt;, it just works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/AnandChowdhary/run-url"&gt;See the source on GitHub&lt;/a&gt; or &lt;a href="https://www.npmjs.com/package/run-url"&gt;Download from npm&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
