<?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: Rukia</title>
    <description>The latest articles on DEV Community by Rukia (@rukiaasm).</description>
    <link>https://dev.to/rukiaasm</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%2F357549%2F2551ab0c-2dc0-480e-8534-108b673d26b1.png</url>
      <title>DEV Community: Rukia</title>
      <link>https://dev.to/rukiaasm</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rukiaasm"/>
    <language>en</language>
    <item>
      <title>Deploying Node.js App with API credentials to Heroku with custom Google Domain</title>
      <dc:creator>Rukia</dc:creator>
      <pubDate>Thu, 30 Jul 2020 14:02:41 +0000</pubDate>
      <link>https://dev.to/rukiaasm/deploying-node-js-app-with-api-credentials-to-heroku-with-custom-google-domain-56h7</link>
      <guid>https://dev.to/rukiaasm/deploying-node-js-app-with-api-credentials-to-heroku-with-custom-google-domain-56h7</guid>
      <description>&lt;p&gt;A few months back I was deploying my Node.js app to heroku with custom Google domain I had 2 errors that had me &lt;strong&gt;STUCK&lt;/strong&gt;! I wanted to share how to overcome those 2 errors with anyone who’s stuck + adding custom Google Domain to your heroku app. Hope it saves you some time and helps you #GetUnstuck #WorkSmarter&lt;/p&gt;

&lt;h4&gt;
  
  
  Errors:
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;apiKey must be defined&lt;/code&gt; can't read API Key error.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Error R10 (Boot timeout) -&amp;gt; Web process failed to bind to $PORT within 60 seconds of launch&lt;/code&gt;. Below is the heroku log that drove me to a rabbit hole of troubleshooting (ps. it isn't a favicon.ico issue).
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=[herokuappurl.herokuapp.com] request_id=79537946-df82–479d-ba7e-accf486764e3 fwd="66.41.109.132" dyno= connect= service= status=503 bytes= protocol=https&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I would highly recommend to download Heroku CLI following these steps : &lt;a href="https://devcenter.heroku.com/articles/heroku-cli" rel="noopener noreferrer"&gt;https://devcenter.heroku.com/articles/heroku-cli&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;sidenote:&lt;/strong&gt; make sure you have this start script in your &lt;code&gt;package.json&lt;/code&gt;&lt;br&gt;
&lt;code&gt;"start": "node server.js"&lt;/code&gt;(or whatever name of your server file ex &lt;code&gt;app.js&lt;/code&gt;)&lt;/p&gt;

&lt;h3&gt;
  
  
  Solving Error 1:
&lt;/h3&gt;

&lt;p&gt;Make sure to store your API_KEY in &lt;code&gt;.env&lt;/code&gt; file &amp;amp; add that to your &lt;code&gt;.gitignore&lt;/code&gt; file for security purposes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;npm install dotenv&lt;/li&gt;
&lt;li&gt;create &lt;code&gt;.env&lt;/code&gt; file and store &lt;code&gt;API_KEY = "abcdef123456789"&lt;/code&gt; &amp;amp;&lt;/li&gt;
&lt;li&gt;in your &lt;code&gt;mail.js&lt;/code&gt; file (where ever you need to call your API_KEY) add &lt;code&gt;require('dotenv').config();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;use &lt;code&gt;process.env&lt;/code&gt; to call API_key :&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;code&gt;auth: {&lt;br&gt;
 api_key: process.env.API_KEY &lt;br&gt;
 }&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once you download the heroku CLI follow these steps-&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;$ heroku login&lt;/code&gt; (Press any key to open up the browser to login to heroku)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$ heroku config:set API_KEY="your_api_key" --app your_heroku_app_name&lt;/code&gt; (make sure the format is &lt;code&gt;FOO=bar&lt;/code&gt; &lt;strong&gt;spacing is important&lt;/strong&gt;)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;terminal response: &lt;code&gt;Setting API_KEY and restarting ⬢ your_heroku_app_name… done, v10 API_KEY: abcdef123456789&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;$ heroku config --app your_heroku_app_name&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Restart your app &lt;code&gt;$ heroku restart --app your_heroku_app_name&lt;/code&gt;
This should solve your &lt;code&gt;apiKey must be defined&lt;/code&gt; error. Now moving on to error 2.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Solving Error 2:
&lt;/h3&gt;

&lt;p&gt;(shoutout to Will Madison from Blacks in Technology-BIT for helping me with this error)&lt;/p&gt;

&lt;p&gt;The main error message is &lt;code&gt;&amp;gt; Web process failed to bind to $PORT within 60 seconds of launch&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In heroku the PORT number has to be read dynamically not statically since heroku sets the PORT variable see &lt;a href="https://devcenter.heroku.com/articles/runtime-principles#web-servers" rel="noopener noreferrer"&gt;https://devcenter.heroku.com/articles/runtime-principles#web-servers&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;in &lt;code&gt;server.js&lt;/code&gt; file change &lt;code&gt;const PORT = 3000;&lt;/code&gt; to &lt;code&gt;const PORT = process.env.PORT || 3000;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;in &lt;code&gt;server.js&lt;/code&gt; also change &lt;code&gt;app.listen(PORT, () =&amp;gt; { log('Server is starting on PORT, ', 3000)}); to app.listen(PORT, () =&amp;gt; { log('Server is starting on PORT, ', process.env.PORT || 3000)});&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Make sure to push code changes to github (or whichever deployment method you picked on heroku) and wait for build and deployment to complete.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In your local environment your port &lt;code&gt;localhost:3000&lt;/code&gt; should still work and in heroku test it with the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;open heroku &lt;strong&gt;Run console&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5ycgi15nrwbu049n77bl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F5ycgi15nrwbu049n77bl.png" alt="screenshot_of_heroku_console"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;run &lt;code&gt;heroku run bash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;when console opens up run your start script &lt;code&gt;$ node server.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;response should be &lt;code&gt;Server is starting on PORT, 52014&lt;/code&gt; (random PORT number heroku choses)&lt;/li&gt;
&lt;li&gt;click &lt;strong&gt;Open app&lt;/strong&gt; &amp;amp; your app should appear.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Adding custom Google Domain to Heroku:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;On heroku go to yourApp and navigate to &lt;strong&gt;Settings&lt;/strong&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fhhlrnwxt6d5qqi3te1jj.png" alt="heroku_settings"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll down to the &lt;strong&gt;Domains&lt;/strong&gt; section &amp;gt; click &lt;strong&gt;Add Domain&lt;/strong&gt; &amp;amp; type domain name (make sure to include &lt;strong&gt;www&lt;/strong&gt;) ex: &lt;a href="http://www.[examplesite].com" rel="noopener noreferrer"&gt;www.[examplesite].com&lt;/a&gt; &amp;gt; click &lt;strong&gt;Next&lt;/strong&gt; &amp;gt; make sure to copy the DNS Target heroku provides&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv2y30pv3oclxj7s1efur.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fv2y30pv3oclxj7s1efur.png" alt="heroku_domain_screen"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Head over to google domains and navigate to &lt;strong&gt;DNS&lt;/strong&gt; section then scroll down to &lt;strong&gt;Synthetic records&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Subdomain forward&lt;/strong&gt; should be selected in the dropdown&lt;/li&gt;
&lt;li&gt;type @ in subdomain field&lt;/li&gt;
&lt;li&gt;in &lt;strong&gt;Destination URL&lt;/strong&gt; field type your domain name &lt;a href="http://www.[examplesite].com" rel="noopener noreferrer"&gt;www.[examplesite].com&lt;/a&gt; (make sure to include &lt;strong&gt;www&lt;/strong&gt; )&lt;/li&gt;
&lt;li&gt;select the below options in photo
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F71ky4jm9s6ho319ipi5g.png" alt="google_domain_screen"&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Add&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Scroll to &lt;strong&gt;Custom resource records&lt;/strong&gt;&lt;br&gt;
removed @ and add &lt;strong&gt;www&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;chose &lt;strong&gt;CNAME&lt;/strong&gt; in dropdown menu&lt;/li&gt;
&lt;li&gt;leave &lt;strong&gt;1h&lt;/strong&gt; as it is&lt;/li&gt;
&lt;li&gt;add DNS target that you copied from heroku in &lt;strong&gt;Domain&lt;/strong&gt; name&lt;/li&gt;
&lt;li&gt;click &lt;strong&gt;Add&lt;/strong&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fckm1jkrl9epva9sa3kd9.png" alt="google domain custom resource records form"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Back to heroku CLI:
&lt;/h4&gt;

&lt;p&gt;(to test if domain name configured correctly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;$ heroku domains — app your_herokue_app_name&lt;/code&gt; (your heroku Domain &amp;amp; custom Domain should appear in terminal)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$ host www.[your_custom_domain].com&lt;/code&gt; (your custom domain name is an alias for DNS Target should appear in terminal along with a few DNS addresses)&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Head over to your custom domain name and your Node.js App should APPEAR! Congratulations!
&lt;/h4&gt;

&lt;p&gt;(sometimes custom Google domains takes about 24–48hrs to appear, for me it appeared after a few hours)&lt;/p&gt;

</description>
      <category>node</category>
      <category>heroku</category>
      <category>googledomain</category>
    </item>
    <item>
      <title>Working Smarter: 5 Steps To Getting Unstuck with Rukia Sheikh-Mohamed</title>
      <dc:creator>Rukia</dc:creator>
      <pubDate>Thu, 23 Jul 2020 11:54:27 +0000</pubDate>
      <link>https://dev.to/rukiaasm/working-smarter-5-steps-to-getting-unstuck-with-rukia-sheikh-mohamed-1932</link>
      <guid>https://dev.to/rukiaasm/working-smarter-5-steps-to-getting-unstuck-with-rukia-sheikh-mohamed-1932</guid>
      <description>&lt;p&gt;I am a software engineer based in the Twin Cities, MN who is passionate about all things tech. During my day job I work as full-stack dev at Soona. I enjoy talking about tech at local and national events/conferences, creating cool stuff on the side, and writing tech articles to share useful information and tips. During my free time I enjoy spending time with my baby boy, traveling the world, and creating fun DIYs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Beginning&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A personal story from my first tech job that change my outlook on ""there is no such thing as a dumb question."" &lt;/li&gt;
&lt;li&gt;Sharing the story on how the types of questions I asked negatively affected my superior's perception of my tech skills. &lt;/li&gt;
&lt;li&gt;State what my talk will consist of: addressing 5 steps with examples of asking effective questions on the internet(stack overflow, medium, google in general) and to team members. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Middle&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Walk through an example of a technical problem that might get you stuck (with code samples) and how to go through the 5 steps to asking the right questions to get to a solution. &lt;/li&gt;
&lt;li&gt;For example 1. Start by doing your own troubleshooting (through the internet, StackOverflow, Medium, Youtube, etc, reading error messages).&lt;/li&gt;
&lt;li&gt;2. Make sure question is specific for example instead of asking ""why am i getting a migration error during rollback-rails"" to ""how to correctly rollback migration column in rails"".&lt;/li&gt;
&lt;li&gt;Go through each of the 5 steps and finally get to the working solution. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;End&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Summarizing 5 steps and take aways&lt;/li&gt;
&lt;li&gt;Ending with story from personal experience how using these steps have helped me work smarter and decreased levels of imposter syndrome by not feeling my questions were dumb questions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://drive.google.com/file/d/1qPs0TT37HofBVLwmhZdEInV_QjqQonL9/view?usp=sharing"&gt;Here is a download link to the talk slides (PDF)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;This talk will be presented as part of &lt;a href="https://codelandconf.com"&gt;CodeLand:Distributed&lt;/a&gt; on &lt;strong&gt;July 23&lt;/strong&gt;.  After the talk is streamed as part of the conference, it will be added to this post as a recorded video.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Glossary&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ruby on Rails: a backend language for web applications&lt;/li&gt;
&lt;li&gt;VueJs: an open-source javascript framework &lt;/li&gt;
&lt;li&gt;rspec: a test tool written in ruby on rails&lt;/li&gt;
&lt;li&gt;capybara: (not the animail 😜) a library that allows us to easily simulate how a user interacts with our app &lt;/li&gt;
&lt;li&gt;devise: a rails gem used for authentication&lt;/li&gt;
&lt;li&gt;system test: allows us to test user interaction for various test cases&lt;/li&gt;
&lt;li&gt;factory_bot: using as a fixtures replacement, which means it helps us produce test data&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>codeland</category>
      <category>troubleshooting</category>
    </item>
  </channel>
</rss>
