<?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:  Mubarak Akinsola</title>
    <description>The latest articles on DEV Community by  Mubarak Akinsola (@mabrouk__a).</description>
    <link>https://dev.to/mabrouk__a</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%2F273422%2F2caaff41-5f3e-4225-bb5a-44be0b1d8d71.jpeg</url>
      <title>DEV Community:  Mubarak Akinsola</title>
      <link>https://dev.to/mabrouk__a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mabrouk__a"/>
    <language>en</language>
    <item>
      <title>YOUR CLONED PROJECT FROM GITHUB IS NOT RUNNING ON THAT NEW COMPUTER BECAUSE NODE MODULE WAS NOT PUSHED TOGETHER WITH OTHER FILES</title>
      <dc:creator> Mubarak Akinsola</dc:creator>
      <pubDate>Fri, 22 Nov 2019 16:06:09 +0000</pubDate>
      <link>https://dev.to/mabrouk__a/your-cloned-project-from-github-is-not-running-on-that-new-computer-because-node-module-was-not-pushed-together-with-other-files-50oi</link>
      <guid>https://dev.to/mabrouk__a/your-cloned-project-from-github-is-not-running-on-that-new-computer-because-node-module-was-not-pushed-together-with-other-files-50oi</guid>
      <description>&lt;p&gt;So, I was having an issue with git and Github today.&lt;br&gt;
I was working on a project on my old computer and decided to clone it and continue with the project on my new computer, after pushing my files to Github from my old computer, I then cloned it on my new computer and decided to continue working on it. To my surprise, I started getting error messages, so basically, my project refused to run on my new computer.&lt;/p&gt;

&lt;p&gt;After a few hours of not understanding what went wrong, I noticed my node module from my old computer did not get pushed with the other files, reason being that there was a 'gitignore' file in my project. &lt;/p&gt;

&lt;p&gt;Ultimately, what the 'gitignore file does is (as the name implies) ignore the node module and does not allow it to get pushed with the rest of the files. &lt;/p&gt;

&lt;p&gt;Although you can choose to push your node module too, but it would take a very long time for your files to get uploaded and at the same time when you try to clone it some other time.&lt;/p&gt;

&lt;p&gt;What you can do when you clone your project on another computer is to run 'npm i' in the terminal and wait for it to finish doing its thing, after which you can now by then, run your project which should now work properly.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>IMPLEMENTING PUG AS YOUR TEMPLATE ENGINE IN YOUR NODE/EXPRESS PROJECT</title>
      <dc:creator> Mubarak Akinsola</dc:creator>
      <pubDate>Sun, 17 Nov 2019 10:52:52 +0000</pubDate>
      <link>https://dev.to/mabrouk__a/implementing-pug-as-your-template-engine-in-your-node-express-project-3k2k</link>
      <guid>https://dev.to/mabrouk__a/implementing-pug-as-your-template-engine-in-your-node-express-project-3k2k</guid>
      <description>&lt;p&gt;It is assumed that you have some knowledge in Node.js and Express for you to really understand this article.&lt;/p&gt;

&lt;p&gt;NB: This does not include your programming logic in your express files, it just shows how to install, implement and render your page on the browser&lt;/p&gt;

&lt;p&gt;Pug is an HTML templating engine, which means you can write much simpler Pug code, which Pug compiler will compile into HTML code, that browser can understand.&lt;br&gt;
Implementing it into your project can be quite easy and it is makes your code concise and easy to read and follow through. Pug is just one of the many template engines available, and just to mention a few, we have EJS, HANDLEBARS, MUSTACHE etc.&lt;/p&gt;

&lt;p&gt;First, Pug can be installed from your computer terminal or directly from your terminal in VS code!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uDgJehFA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/l4rb2h13r865umxr3o9s.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uDgJehFA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/l4rb2h13r865umxr3o9s.PNG" alt="Installing Pug"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You install the Pug template engine with the above command (npm install --save pug) and node does the installation in no time.&lt;br&gt;
From then on, you must have had an  app.js file in your project. Now, it gets a little tricky, why? Because you don't have to require pug from node module with 'require' keyword.&lt;/p&gt;

&lt;p&gt;You simply use it in your project such like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c-qVfhtn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/phoem02gql6fia083vni.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c-qVfhtn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/phoem02gql6fia083vni.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The 'View Engine' above tells express which template engine that is being used in the project. If you choose to use any other template engine, it wouldn't be 'pug' you put above, rather, it would be your chosen engine.&lt;/p&gt;

&lt;p&gt;Now, let's look at the code below:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Elf_E6zB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tqnsp3kkiikmu4knvg80.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Elf_E6zB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tqnsp3kkiikmu4knvg80.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And as to regards the 'Views', it tells express where to find our views (Our html pages), however the default setting is basically our main directory and the 'Views' folder (You could check the docs for more understanding).&lt;br&gt;
If you would put your html pages in another folder which is not called 'Views', maybe your choose to name it 'shows', then you have to set it such like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S0TRnY23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dmqc90ijla39movs9exn.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S0TRnY23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dmqc90ijla39movs9exn.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This way, you have successfully brought in pug into your application. Now when it gets to the point of serving your page.To serve your page in any of your javascript file, you do this below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CnvyWtBg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5kvphjnfqb1kq9twrpa8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CnvyWtBg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/5kvphjnfqb1kq9twrpa8.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, You see the 'shop' above. don't be shocked. This is just the name of the file where I have the html page I would be rendering. It could have been 'shop.pug' as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w9_61j7d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/x5ncltjccrjyv54wgur3.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w9_61j7d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/x5ncltjccrjyv54wgur3.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So you can decide to add the extension '.pug' or choose not,it would still work regardless.&lt;/p&gt;

</description>
      <category>node</category>
      <category>express</category>
      <category>pug</category>
    </item>
  </channel>
</rss>
