<?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: Sabarish Rajamohan</title>
    <description>The latest articles on DEV Community by Sabarish Rajamohan (@sabarishcodes).</description>
    <link>https://dev.to/sabarishcodes</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%2F455981%2Ff2ff3d2e-bc80-49c2-9ee3-4660c73cdad0.jpeg</url>
      <title>DEV Community: Sabarish Rajamohan</title>
      <link>https://dev.to/sabarishcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sabarishcodes"/>
    <language>en</language>
    <item>
      <title>Tunneling using Ngrok - What, Why, and How to?</title>
      <dc:creator>Sabarish Rajamohan</dc:creator>
      <pubDate>Thu, 24 Sep 2020 15:10:05 +0000</pubDate>
      <link>https://dev.to/sabarishcodes/tunneling-using-ngrok-what-why-and-how-to-3n7a</link>
      <guid>https://dev.to/sabarishcodes/tunneling-using-ngrok-what-why-and-how-to-3n7a</guid>
      <description>&lt;p&gt;Hello everyone. Today we'll be looking at what &lt;code&gt;ngrok&lt;/code&gt; is, why as a developer you would need it, and how to install, configure, and use &lt;code&gt;ngrok&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Before diving into the content of this article, let me tell you a scenario that you would have faced. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Suppose you want to demo your developed application with your colleagues or your team-mates or to anyone you want to receive feedback from. If you were like me and didn't know about &lt;code&gt;ngrok&lt;/code&gt; before,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You would have asked the person to either swing by your desk or took your laptop to them to demo it.&lt;/li&gt;
&lt;li&gt;You might have pushed your changes to a Github repository, asked them to clone it in their local machine and view it.&lt;/li&gt;
&lt;li&gt;You would have deployed it and shared the link to access the deployment.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;em&gt;What if there is an alternative to this? This is where **Ngrok&lt;/em&gt;* comes into play.*&lt;/p&gt;




&lt;h2&gt;
  
  
  What is Ngrok?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://ngrok.com/" rel="noopener noreferrer"&gt;Ngrok&lt;/a&gt; is an application developed by &lt;a href="https://github.com/inconshreveable" rel="noopener noreferrer"&gt;Alan Shreeve&lt;/a&gt;, enables developers to expose their local development servers to the internet. It basically creates a tunnel to your local development server and generates two random subdomains on ngrok.com - one &lt;code&gt;http&lt;/code&gt; and another with &lt;code&gt;https&lt;/code&gt;. With these generated addresses, you can view the locally developed application from anywhere through the Internet provided that the development server is kept running. &lt;/p&gt;

&lt;p&gt;They provide various tunnel servers around the world and locations and even the &lt;code&gt;ngrok&lt;/code&gt; server software can be self-hosted on a VPS or dedicated server. They provide a free and few paid plans with some additional features to each plan like - Custom domain, Google Apps SSO, Whitelabel Domains and much &lt;a href="https://www.ngrok.com/pricing" rel="noopener noreferrer"&gt;more&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do you need &lt;code&gt;ngrok&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Other than just demoing developed applications, &lt;code&gt;ngrok&lt;/code&gt; can also be used for :-&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Running a personal service of your own on the cloud.&lt;/li&gt;
&lt;li&gt;Testing out mobile apps that have a local backend server.&lt;/li&gt;
&lt;li&gt;Building and testing out webhooks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We covered the &lt;strong&gt;What&lt;/strong&gt; and the &lt;strong&gt;Why&lt;/strong&gt;. Now let's move on to the &lt;strong&gt;How&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use &lt;code&gt;ngrok&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;ngrok&lt;/code&gt; is so simple. Before you start tunnelling your local servers using &lt;code&gt;ngrok&lt;/code&gt;, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Setup and installation&lt;/li&gt;
&lt;li&gt;Configuring &lt;code&gt;ngrok&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Launching the tunnel&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  1. Setup and installation
&lt;/h3&gt;

&lt;p&gt;To start using &lt;code&gt;ngrok&lt;/code&gt;, we have to &lt;a href="https://dashboard.ngrok.com/signup" rel="noopener noreferrer"&gt;signup&lt;/a&gt; an account on &lt;code&gt;ngrok&lt;/code&gt;.&lt;br&gt;
After you signup, it takes you to the dashboard. Your dashboard must look something like this.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxza43stytltci59owwja.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%2Fxza43stytltci59owwja.png" alt="dashboard.png" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Download the correct package according to your operating system. The steps to install are mentioned there but I am going to put it down for you as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Windows&lt;/strong&gt; :-&lt;br&gt;
 Download the zip and extract the executable file and run it.&lt;/p&gt;

&lt;p&gt;To access &lt;code&gt;ngrok&lt;/code&gt; from anywhere on your command prompt, &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Move executable file ngrok.exe to C:\Windows\system32\ngrok.exe&lt;/li&gt;
&lt;li&gt;Add Environment Variables via UI (search for "Edit the environment variables for your account" in the search bar next to windows logo =&amp;gt; double click on Path under Users Variables for yourusername =&amp;gt; Click New =&amp;gt; add your path C:\Windows\system32\ngrok.exe =&amp;gt; click OK.&lt;/li&gt;
&lt;li&gt;Restart your bash and you should be able to run "ngrok http 80" command.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;For Mac / Linux&lt;/strong&gt; :-&lt;br&gt;
Run the below command on your terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;unzip /path/to/ngrok.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Either move the file to /usr/local/bin or add the path to &lt;code&gt;ngrok&lt;/code&gt; to &lt;code&gt;.bashrc&lt;/code&gt; or &lt;code&gt;.zshrc&lt;/code&gt; according to the shell you're using.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Configuring &lt;code&gt;ngrok&lt;/code&gt;
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Remove the &lt;code&gt;./&lt;/code&gt; and run the following commands if you're doing this on Command Prompt on Windows.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The next step is to authenticate the client you have installed on your system with your &lt;code&gt;ngrok&lt;/code&gt; account.&lt;/p&gt;

&lt;p&gt;Run the following command on your terminal / prompt :-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./ngrok authtoken YOUR_AUTH_TOKEN
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;YOUR_AUTH_TOKEN is the token that is displayed on the dashboard. This saves the auth_token of your account to a .yml file in your local machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Launching the tunnel
&lt;/h3&gt;

&lt;p&gt;This is the last step to launch your local development server to the internet via &lt;code&gt;ngrok&lt;/code&gt; tunnel without deployment. &lt;br&gt;
Type in the below command :-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./ngrok http 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;code&gt;80&lt;/code&gt; is the port number where your local server is running. You would have to change it to the &lt;code&gt;PORT NUMBER&lt;/code&gt; of the local server you are running.  Make sure the development server for the application you want to tunnel is up and running.&lt;/p&gt;

&lt;p&gt;For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./ngrok http 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;./ngrok http 5000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By running this command, your terminal / prompt should look something like this.&lt;br&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%2Fic7ip7u6r3xr71s3f8pv.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%2Fic7ip7u6r3xr71s3f8pv.png" alt="prompt.PNG" width="800" height="465"&gt;&lt;/a&gt;&lt;br&gt;
This shows the randomly generated subdomains where your application is accessible. Additionally, you also get to use the local dashboard at port &lt;code&gt;4040&lt;/code&gt;, where you can see all the requests being made through the generated subdomains.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxq8doy3eg7e7lp57suwa.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%2Fxq8doy3eg7e7lp57suwa.png" alt="local dashboard.PNG" width="800" height="391"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  That is it!! You have successfully launched a &lt;code&gt;ngrok&lt;/code&gt; tunnel for your application
&lt;/h3&gt;

&lt;p&gt;In the free plan, you can only have one session. You can close your session by giving &lt;code&gt;Ctrl + C&lt;/code&gt; or killing the &lt;code&gt;ngrok&lt;/code&gt; process.&lt;/p&gt;

&lt;p&gt;I hope you got a clear idea on what &lt;code&gt;ngrok&lt;/code&gt; is, why it is needed and how to tunnel your local application through &lt;code&gt;ngrok&lt;/code&gt;.  Let me know if it helped you in the comments :)&lt;/p&gt;




&lt;h3&gt;
  
  
  References:
&lt;/h3&gt;

&lt;p&gt;Still curious on how &lt;code&gt;ngrok&lt;/code&gt; does it for you? Check out these resources.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.ngrok.com/product" rel="noopener noreferrer"&gt;ngrok site&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.pubnub.com/learn/glossary/what-is-ngrok/" rel="noopener noreferrer"&gt;A blog about ngrok on Pubnub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/inconshreveable/ngrok/blob/master/docs/DEVELOPMENT.md" rel="noopener noreferrer"&gt;Developer documentation on ngrok&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/blog/2014/03/configure-windows-for-local-webhook-testing-using-ngrok.html" rel="noopener noreferrer"&gt;Twilio blog on setting up Ngrok on Windows&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>tunneling</category>
      <category>ngrok</category>
      <category>networking</category>
    </item>
    <item>
      <title>CSS Gamification: Flexbox Froggy</title>
      <dc:creator>Sabarish Rajamohan</dc:creator>
      <pubDate>Tue, 15 Sep 2020 11:22:16 +0000</pubDate>
      <link>https://dev.to/sabarishcodes/css-gamification-flexbox-froggy-27am</link>
      <guid>https://dev.to/sabarishcodes/css-gamification-flexbox-froggy-27am</guid>
      <description>&lt;p&gt;As a developer who works predominantly on the backend, I have always found myself taking more time trying to use the right CSS properties, to get the right kind of style for my website or my application. &lt;/p&gt;

&lt;p&gt;Especially &lt;em&gt;aligning elements correctly and spacing them&lt;/em&gt;. &lt;br&gt;
Oh boy, that was tough !! At least for me.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;em&gt;Enter Flexbox&lt;/em&gt;
&lt;/h2&gt;

&lt;p&gt;So, I fired up Chrome and browsed through several articles which gave me an idea of how to use flexbox in my CSS.  And I discovered this game where you are able to learn flexbox by practically trying it out right away. &lt;/p&gt;

&lt;h1&gt;
  
  
  &lt;a href="https://flexboxfroggy.com/" rel="noopener noreferrer"&gt;FlexBox Froggy&lt;/a&gt;
&lt;/h1&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%2Fi2u0sqe9wwsn1spslzhf.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%2Fi2u0sqe9wwsn1spslzhf.png" alt="flexbox_froggy_level1" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, this game, developed by &lt;a href="https://codepip.com/" rel="noopener noreferrer"&gt;CodePiP&lt;/a&gt;, is free to play, and really helpful if you want to try out flexbox. You might need to have the knowledge of basic CSS, and need not even know or understand flexbox before. You don't even need to create an account to play it either.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftb9jxxpu85jxaarsow7o.gif" 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%2Ftb9jxxpu85jxaarsow7o.gif" alt="gametime" width="576" height="324"&gt;&lt;/a&gt;&lt;br&gt;
The game involves 24 levels, where you have to help Froggy, the frog, and his friends to reach the lilypads placed around them.&lt;br&gt;
The difficulty increases as we progress through the levels.&lt;/p&gt;

&lt;p&gt;There are three difficulty levels:-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Beginner - Tips and directions are displayed&lt;/li&gt;
&lt;li&gt;Intermediate - Tips and directions are disabled, but the difficulty increases as you progress through consecutive levels.&lt;/li&gt;
&lt;li&gt;Expert - Random levels and no tips are displayed.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you're a person who is already familiar with flexbox and just wants to try out the game, try the Intermediate or Advanced level.&lt;/p&gt;

&lt;p&gt;It was really fun as I made progress through the levels. &lt;br&gt;
Before I tell you about what all I was able to learn from the game, Here's an image from MDN docs to help give you an understanding of the flex container and the axes.&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%2Fdeveloper.mozilla.org%2Ffiles%2F3739%2Fflex_terms.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%2Fdeveloper.mozilla.org%2Ffiles%2F3739%2Fflex_terms.png" alt="flexbox-axes" width="800" height="400"&gt;&lt;/a&gt;&lt;br&gt;
Each of the properties mentioned below take values to position your elements according to your need.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;justify-content&lt;/code&gt;: Aligns elements across the &lt;code&gt;main axis&lt;/code&gt;, i.e horizontally.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;align-items&lt;/code&gt;: Aligns elements across the &lt;code&gt;cross-axis&lt;/code&gt;, i.e vertically.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-direction&lt;/code&gt;: Defines the direction of the &lt;code&gt;main axis&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Quick Note&lt;/strong&gt;:  When the &lt;code&gt;flex-direction&lt;/code&gt; property takes the value as &lt;code&gt;column&lt;/code&gt;, &lt;code&gt;justify-content&lt;/code&gt; and &lt;code&gt;align-items&lt;/code&gt; change their axes with each other. If you play through the game, it occurs on Level 11.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;flex-wrap&lt;/code&gt;: Takes the child elements to additional lines when they overflow&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;flex-flow&lt;/code&gt;: A shorthand property for both &lt;code&gt;flex-direction&lt;/code&gt; and &lt;code&gt;flex-wrap&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;align-content&lt;/code&gt;: Determines the spacing between the lines. It has no effect if there is only one line. Level 21 helps us understand this&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a beginner, I found it very useful to learn flexbox. Do try out the game and let me know in the comments how it turned out for you 💜&lt;/p&gt;




&lt;p&gt;References :  &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/CSS/CSS_layout/Flexbox" rel="noopener noreferrer"&gt;MDN Docs&lt;/a&gt; &lt;/p&gt;

</description>
      <category>frontend</category>
      <category>css3</category>
      <category>cssflexbox</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
