<?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: Dimas López</title>
    <description>The latest articles on DEV Community by Dimas López (@dimaslz).</description>
    <link>https://dev.to/dimaslz</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%2F29467%2F747a205e-62fa-4552-8d37-c4282ceba160.png</url>
      <title>DEV Community: Dimas López</title>
      <link>https://dev.to/dimaslz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dimaslz"/>
    <language>en</language>
    <item>
      <title>Create an icon component from a SVG icon</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Fri, 30 Jun 2023 16:17:12 +0000</pubDate>
      <link>https://dev.to/dimaslz/create-an-icon-component-from-a-svg-icon-2n0o</link>
      <guid>https://dev.to/dimaslz/create-an-icon-component-from-a-svg-icon-2n0o</guid>
      <description>&lt;p&gt;Every time when you have an icon in SVG, and you want to use it in a application, you need to adapt it to the correspond syntax of the framework. This is something repetitive and tired: remove unnecessary attributes, add inherit classes, inherit styles, add size properties, stroke if apply, ...&lt;/p&gt;

&lt;p&gt;Then, inspired on this &lt;a href="https://svg2jsx.com"&gt;https://svg2jsx.com&lt;/a&gt;, a tool to create a React component from a SVG, I created &lt;a href="https://svg-icon-2-fw-component.dimaslz.dev/"&gt;https://svg-icon-2-fw-component.dimaslz.dev/&lt;/a&gt;, a tool to create any framework (angular, vue2, vue3, react, svelte, ...) component, with Javascript or Typescript variant, form a SVG.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://svg-icon-2-fw-component.dimaslz.dev"&gt;https://svg-icon-2-fw-component.dimaslz.dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Copy some SVG icon (go here for example &lt;a href="https://heroicons.com"&gt;https://heroicons.com&lt;/a&gt;, and copy the SVG version)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste the content on the left editor (paste SVG string content or drop multiple SVG files here)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OYQCNHM_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lmpbtqh91790828vw35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OYQCNHM_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lmpbtqh91790828vw35.png" alt="Default view" width="800" height="371"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wait to generate the default component (React in JSX)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--89zm3qT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5zcpo5kmny2vgdbg2d9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--89zm3qT7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5zcpo5kmny2vgdbg2d9.png" alt="SVG converter working" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;And choose to desired framework, Svelte + Typescript for example&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_CWejy0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oiawryeefd8nj50quj4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_CWejy0j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oiawryeefd8nj50quj4r.png" alt="Choose your option" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You have a good base Svelte component in Typescript&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"ts"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;stroke&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt;
  &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt;
  &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt;
  &lt;span class="na"&gt;stroke=&lt;/span&gt;&lt;span class="s"&gt;"currentColor"&lt;/span&gt;
  &lt;span class="na"&gt;stroke-width=&lt;/span&gt;&lt;span class="s"&gt;{stroke}&lt;/span&gt;
  &lt;span class="na"&gt;viewBox=&lt;/span&gt;&lt;span class="s"&gt;"0 0 24 24"&lt;/span&gt;
  &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;{`width:&lt;/span&gt; &lt;span class="err"&gt;${&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="na"&gt;px&lt;/span&gt;&lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="na"&gt;height:&lt;/span&gt; &lt;span class="err"&gt;${&lt;/span&gt;&lt;span class="na"&gt;size&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt;&lt;span class="na"&gt;px&lt;/span&gt;&lt;span class="err"&gt;;&lt;/span&gt; &lt;span class="na"&gt;stroke-width=&lt;/span&gt;&lt;span class="s"&gt;${stroke};`}&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;gt;&amp;lt;path&lt;/span&gt;
    &lt;span class="na"&gt;stroke-linecap=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
    &lt;span class="na"&gt;stroke-linejoin=&lt;/span&gt;&lt;span class="s"&gt;"round"&lt;/span&gt;
    &lt;span class="na"&gt;d=&lt;/span&gt;&lt;span class="s"&gt;"M4.26 10.147a60.436 60.436 0 0 0-.491 6.347A48.627 48.627 0 0 1 12 20.904a48.627 48.627 0 0 1 8.232-4.41 60.46 60.46 0 0 0-.491-6.347m-15.482 0a50.57 50.57 0 0 0-2.658-.813A59.905 59.905 0 0 1 12 3.493a59.902 59.902 0 0 1 10.399 5.84 51.39 51.39 0 0 0-2.658.814m-15.482 0A50.697 50.697 0 0 1 12 13.489a50.702 50.702 0 0 1 7.74-3.342M6.75 15a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5zm0 0v-3.675A55.378 55.378 0 0 1 12 8.443m-7.007 11.55A5.981 5.981 0 0 0 6.75 15.75v-1.5"&lt;/span&gt;
  &lt;span class="nt"&gt;/&amp;gt;&amp;lt;/svg&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How to use it with multiple svg files?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Drag and drop your SVG files&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lkDZlI4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2igjxjhujdz5koswiow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lkDZlI4e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k2igjxjhujdz5koswiow.png" alt="Drag and drop SVG files" width="800" height="637"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose your framework&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PvAxYNST--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qz7pb4lhpwqd2b7jtpr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PvAxYNST--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1qz7pb4lhpwqd2b7jtpr.png" alt="Choose your framework" width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Choose the Language (Javascript or Typescript)&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uFR7k943--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5oh0uv09u10yljd4acfo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uFR7k943--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5oh0uv09u10yljd4acfo.png" alt="Choose the language" width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download the icons in a zip file&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kcBcybNs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5o3nj3fzt064h9fg2b0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kcBcybNs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b5o3nj3fzt064h9fg2b0.png" alt="Download icons" width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The format of the filename is &lt;code&gt;icon-builder-{datetime}-framework.zip&lt;/code&gt;. Inside this file, you will have all the files to use in your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  End
&lt;/h2&gt;

&lt;p&gt;Do you like it?, I appreciate feedback. Feel free to add issues to the repo here &lt;a href="https://github.com/dimaslz/icon-lib-builder"&gt;https://github.com/dimaslz/icon-lib-builder&lt;/a&gt; and give me a ⭐️ to motivate me to continue working on it.&lt;/p&gt;

&lt;p&gt;Thank you for reading and, happy coding! 👨‍💻&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>automation</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Managing local SSL certificates without port (cli)</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Sun, 18 Jun 2023 08:39:26 +0000</pubDate>
      <link>https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-cli-4lfm</link>
      <guid>https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-cli-4lfm</guid>
      <description>&lt;p&gt;Days ago, I &lt;a href="https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-3n6d"&gt;published a post&lt;/a&gt; talking about a script to automate the creation of certificates for local domains: &lt;a href="https://github.com/dimaslz/local-ssl-management"&gt;https://github.com/dimaslz/local-ssl-management&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now I want to share with you a different way to solve the same use case, but in a more convenient manner using a CLI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use case
&lt;/h2&gt;

&lt;p&gt;If you are using a local domain with HTTPS, for example, like &lt;a href="https://local.your-domain.com:3000"&gt;https://local.your-domain.com:3000&lt;/a&gt;, and you want to remove the port, you can only have one application running on the same port. Another detail is that you need to add a special setup in the project to serve it on port 443. There are other options, but they involve more manual steps.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I always try to avoid specific settings just for the local environment. The project should have as few differences as possible from the production setup.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Another nuisance with using ports in the URL, in my opinion, is when you have the URL set in multiple services, like GitHub, for the authentication process. If you need to change the port for some reason, you have to go back to GitHub and update the port.&lt;/p&gt;

&lt;p&gt;As I enjoy automation scripts, I have created a CLI to automate the creation of local certificates (supported by &lt;a href="https://github.com/FiloSottile/mkcert"&gt;mkcert&lt;/a&gt;) and remove the ports from the URL using a Docker image based on Nginx.&lt;/p&gt;

&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsdg9Ial--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/dimaslz/local-ssl-management/main/architecture-schema.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsdg9Ial--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/dimaslz/local-ssl-management/main/architecture-schema.png" alt="How this proxy works" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;npm install -g @dimaslz/local-ssl-management-cli&lt;/code&gt; &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Requirements: docker, node and mkcert&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  How to use
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;You can read commands here: &lt;a href="https://github.com/dimaslz/local-ssl-management#commands"&gt;https://github.com/dimaslz/local-ssl-management#commands&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you install the package globally, you can use &lt;code&gt;local-ssl&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌[dimaslz@mbp14] [/dev/ttys106]
└[~]&amp;gt; local-ssl
Usage: local-ssl [options] [command]

Options:
  -h, --help                    display help for command

Commands:
  create [options] &amp;lt;domain&amp;gt;     Create domain
  list                          List domains
  update [options] &amp;lt;domain|id&amp;gt;  update domain
  remove &amp;lt;domain|id&amp;gt;            Create domain
  help [command]                display help for command
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Create your first domain
&lt;/h4&gt;

&lt;p&gt;Now, you do not have any config. If you run the command &lt;code&gt;local-ssl list&lt;/code&gt; you will see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌[dimaslz@mbp14] [/dev/ttys106] [1]
└[~]&amp;gt; local-ssl list

id        key        domains        port
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, lets imagine you have a project running on &lt;a href="http://localhost:3000"&gt;http://localhost:3000&lt;/a&gt; and you want to use a SSL certificate with a custom domain like &lt;a href="https://local.your-domain.com"&gt;https://local.your-domain.com&lt;/a&gt;. So, first you need to update your &lt;code&gt;/etc/hosts&lt;/code&gt; as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;127.0.0.1       local.your-domain.com
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;after, you can run the command:&lt;br&gt;
&lt;code&gt;local-ssl create local.your-domain.com --port 3000&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;┌[dimaslz@mbp14] [/dev/ttys106]
└[~]&amp;gt; local-ssl create local.your-domain.com --port 3000

The local ssl proxy is running.

ℹ️  The local ssl proxy is running. Keep it mind that it is important to the local domains that works through HTTPS.


┌──────────────┬──────────────────────┬──────────────────────────────────────────┐
│ container id │ container image      │ port                                     │
├──────────────┼──────────────────────┼──────────────────────────────────────────┤
│ 5f340ae86786 │ local-ssl-management │ 0.0.0.0:80-&amp;gt;80/tcp, 0.0.0.0:443-&amp;gt;443/tcp │
└──────────────┴──────────────────────┴──────────────────────────────────────────┘


SSL proxy running


domain                                app running
https://local.your-domain.com         ❌
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;✅ - is when the application is success on ping&lt;br&gt;
❌ - is when the application fails on ping&lt;br&gt;
In my example, I did not have an application running on port 3000&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And now, you can test your domain &lt;a href="https://local.your-domain.com"&gt;https://local.your-domain.com&lt;/a&gt; (instead of &lt;a href="https://local.your-domain.com:3000"&gt;https://local.your-domain.com:3000&lt;/a&gt;) in your browser and should work.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By default, a SSL cert for &lt;code&gt;localhost&lt;/code&gt; is created.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  End
&lt;/h4&gt;

&lt;p&gt;This is something that works for me, and perhaps it can work for you as well. &lt;/p&gt;

&lt;p&gt;Feedback is welcome. If you like it or have any ideas to improve the command, please give me a ⭐️ in Github &lt;a href="https://github.com/dimaslz/local-ssl-management"&gt;https://github.com/dimaslz/local-ssl-management&lt;/a&gt; to motivate me to continue sharing work.&lt;/p&gt;

&lt;p&gt;Thank you for reading and, happy coding! 👨‍💻&lt;/p&gt;

</description>
      <category>docker</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Managing local SSL certificates without port</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Thu, 15 Jun 2023 00:03:51 +0000</pubDate>
      <link>https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-3n6d</link>
      <guid>https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-3n6d</guid>
      <description>&lt;p&gt;CLI version here &lt;a href="https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-cli-4lfm"&gt;https://dev.to/dimaslz/managing-local-ssl-certificates-without-port-cli-4lfm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Sometimes we need to use HTTPS domain while we are working locally and, we use the basic url with the port where is running the project like &lt;a href="https://localhost:3000"&gt;https://localhost:3000&lt;/a&gt;. Also, sometimes, is recommended to have a similar TLD as the real domain in production, something like &lt;a href="https://local.your-domain.com:3000"&gt;https://local.your-domain.com:3000&lt;/a&gt;, because maybe, we need to do something related to the TLD, like handle default language or something else.&lt;/p&gt;

&lt;p&gt;As you can see, we need to add the PORT (3000). What happen if you want to remove the port in the url but, serving the application running in a port? You can not do it. You only can use 1 application running in the port 443 and, you need to add a special setting to the runner of the project, to serve the application in the 443 port (ssl). Other solutions are a bit complex, modifying something in your system manually probably (manually multiple times === will be tedious). &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I try to avoid specific settings just for local environment, the project should have the less or any differences as possible with the production setting.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Also, another nuisance using the ports in the url, in my opinion, is when you have the URL set in multiple services, like Github, to make the authentication process. Then, if you need to change the port for some reason, you need to back to Github and update the port. &lt;/p&gt;

&lt;p&gt;As I like automation scripts, I have created a script to automate to create local certifications (supported by &lt;a href="https://github.com/FiloSottile/mkcert"&gt;mkcert&lt;/a&gt;) and remove the PORT's from the url through a proxy with Docker image base on Nginx.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsdg9Ial--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/dimaslz/local-ssl-management/main/architecture-schema.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wsdg9Ial--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://raw.githubusercontent.com/dimaslz/local-ssl-management/main/architecture-schema.png" alt="How this proxy works" width="800" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the Github repository if you want to try it: &lt;a href="https://github.com/dimaslz/local-ssl-management-docker"&gt;https://github.com/dimaslz/local-ssl-management-docker&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(copied and pasted from: &lt;a href="https://github.com/dimaslz/local-ssl-management-docker#how-to-use"&gt;https://github.com/dimaslz/local-ssl-management-docker#how-to-use&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;#1 - Update your /etc/hosts&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;OSX:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;...
127.0.0.1        local.your-domain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;#2 - Setup config&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"domain"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"local.your-domain.com"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"port"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;application&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;is&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;running&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;http://localhost:&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;#3 - Run your application&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;The script will work but, if your application is not running, the domain will not resolve the source.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;#4 - Run the script&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Before all, build the script by running &lt;code&gt;yarn build&lt;/code&gt; and after &lt;code&gt;yarn up&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The script will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check the &lt;code&gt;config.json&lt;/code&gt; file, creating the new SSL certificates if needed.&lt;/li&gt;
&lt;li&gt;Create the &lt;code&gt;nginx.conf&lt;/code&gt; per each domain.&lt;/li&gt;
&lt;li&gt;Generate the &lt;code&gt;Dockerfile&lt;/code&gt; configuration.&lt;/li&gt;
&lt;li&gt;Remove and create the new image (named &lt;code&gt;local-ssl-management&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Remove and create the new container (named &lt;code&gt;local-ssl-management&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;All files will be into &lt;code&gt;.temp&lt;/code&gt; folder (do not touch it).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;#4 - Go to your domain and check it&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;Open the application url: &lt;a href="https://local.your-domain.com"&gt;https://local.your-domain.com&lt;/a&gt; and... should work 😅.&lt;/p&gt;

&lt;h2&gt;
  
  
  END!
&lt;/h2&gt;

&lt;p&gt;This is something that works for me, and maybe it works for you too. &lt;/p&gt;

&lt;p&gt;I will continue working on it, this is my next iteration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add certs manually&lt;/li&gt;
&lt;li&gt;Add custom nginx config&lt;/li&gt;
&lt;li&gt;CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feedback are welcome. If you like it, give me a ⭐️ in Github &lt;a href="https://github.com/dimaslz/local-ssl-management"&gt;https://github.com/dimaslz/local-ssl-management&lt;/a&gt; to motivate me to continue sharing work.&lt;/p&gt;

&lt;p&gt;Thank you for reading and, happy coding! 👨‍💻&lt;/p&gt;

</description>
      <category>mkcert</category>
      <category>ssl</category>
      <category>docker</category>
      <category>development</category>
    </item>
    <item>
      <title>Improving NgClass expression</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Sun, 12 Sep 2021 15:30:40 +0000</pubDate>
      <link>https://dev.to/dimaslz/improving-ngclass-expression-3aim</link>
      <guid>https://dev.to/dimaslz/improving-ngclass-expression-3aim</guid>
      <description>&lt;p&gt;Sometimes happens that when you are working with a framework, you miss some features of the other. For me, this is something common because I work in Angular, Vue and (P)React (maybe others) almost every day and, when I work in Angular, I miss Vue, when I work in Vue I miss React and bla bla bla.&lt;/p&gt;

&lt;p&gt;Today, let's talk about one difference between Vue and Angular in the class expression possibilities. Maybe, you should have some experience with Vue and Angular to get the point of this article.&lt;/p&gt;

&lt;p&gt;For example, in Angular, you can use the following &lt;code&gt;[ngClass]&lt;/code&gt; expressions:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Let's omit &lt;code&gt;[ngClass]="stringExp|arrayExp|objExp"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- example of ngClass in Angular --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;[ngClass]=&lt;/span&gt;&lt;span class="s"&gt;"'first second'"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;[ngClass]=&lt;/span&gt;&lt;span class="s"&gt;"['first', 'second']"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt;
  &lt;span class="na"&gt;[ngClass]=&lt;/span&gt;&lt;span class="s"&gt;"{'first': true, 'second': true, 'third': false}"&lt;/span&gt;
&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;[ngClass]=&lt;/span&gt;&lt;span class="s"&gt;"{'class1 class2 class3' : true}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;...&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the options is to use any expression as Array, Object or String where the first result, at the first level (first child) should return a string but, if you want to mix both or use a deeper child item, maybe you will have an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- with ngClass of Angular --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;[ngClass]=&lt;/span&gt;&lt;span class="s"&gt;"[{'classA': true}, 'classB']"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;
&lt;span class="c"&gt;&amp;lt;!-- ERROR Error: NgClass can only toggle CSS classes expressed as strings, got [object Object] --&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the example above, is a mix: An Array with an Object and String as item values.&lt;/p&gt;

&lt;p&gt;If you have been working in Vue, you know that you can use more flexible expressions, so, the the example in Angular, we can do in Vue as in the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- with :class of Vue --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;:class=&lt;/span&gt;&lt;span class="s"&gt;"[{'classA': true}, 'classB']"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For that, in my last applications, I made a directive to solve it and, the example is something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- with ngVClass of Angular --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;some-element&lt;/span&gt; &lt;span class="na"&gt;[ngVClass]=&lt;/span&gt;&lt;span class="s"&gt;"[{'classA': true}, 'classB']"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  ...
&lt;span class="nt"&gt;&amp;lt;/some-element&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The example above works. This is a directive that allows you to work with classes in Angular as in Vue.&lt;/p&gt;

&lt;p&gt;Then I decided to share to the community publishing in a npm package &lt;a href="https://ng-v-class.dimaslz.dev"&gt;https://ng-v-class.dimaslz.dev&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As always, I hope could be helpful, at least as learning. Feedback are welcome, support the library clicking in the star in the repo, always helps.&lt;/p&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Use heroicons.com in your Angular applications</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Thu, 01 Oct 2020 14:25:27 +0000</pubDate>
      <link>https://dev.to/dimaslz/use-heroicons-com-in-your-angular-applications-33ke</link>
      <guid>https://dev.to/dimaslz/use-heroicons-com-in-your-angular-applications-33ke</guid>
      <description>&lt;p&gt;I love &lt;a href="https://tailwindcss.com"&gt;TailwindCSS&lt;/a&gt; and, when I use it I need icons, then usually I use &lt;a href="https://fontawesome.com/icons"&gt;Fontawesome&lt;/a&gt;, it is a common option, or I use free opensource icons from some platforms, but you need to create your own collection. But there is a great option recommended and made by the &lt;a href="https://tailwindcss.com"&gt;TailwindCSS&lt;/a&gt; makers and designed by  &lt;a href="https://twitter.com/steveschoger"&gt;@steveschoger&lt;/a&gt;, this is &lt;a href="https://heroicons.com"&gt;heroicons.com&lt;/a&gt; with around 226 Icons in SVG. Each icon, you can copy and paste the SVG and use it but is not a maintainable way.&lt;/p&gt;

&lt;p&gt;So I create an Angular icon library, based in &lt;a href="https://heroicons.com"&gt;heroicons.com&lt;/a&gt; to use un my application easily but at the same time, for fun and share my utilities to the community.&lt;/p&gt;

&lt;p&gt;Take a look this playground: &lt;a href="https://ng-heroicons.dimaslz.dev"&gt;https://ng-heroicons.dimaslz.dev&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use
&lt;/h2&gt;

&lt;p&gt;First, install the dependency with npm or yarn.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;yarn add @dimaslz/ng-heroicons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, add the module to the module where you want to use, commonly in the app.module.ts to can use around all application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// app.module.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;NgHeroiconsModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@dimaslz/ng-heroicons&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ...&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;NgModule&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;declarations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;imports&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;BrowserModule&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;NgHeroiconsModule&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
  &lt;span class="na"&gt;providers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt;
  &lt;span class="na"&gt;bootstrap&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;AppComponent&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;AppModule&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="c1"&gt;//...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then, use any icons with the following syntax: Outline icons with the suffix &lt;code&gt;-outline-icon&lt;/code&gt; and &lt;code&gt;-solid-icon&lt;/code&gt; for solid ones.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- outline example --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-outline-icon&amp;gt;&amp;lt;/thumb-up-outline-icon&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- solid example --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-solid-icon&amp;gt;&amp;lt;/thumb-up-solid-icon&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Multiple examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;lt;!-- outline with stroke 1 and color pink --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-outline-icon&lt;/span&gt; &lt;span class="na"&gt;stroke=&lt;/span&gt;&lt;span class="s"&gt;"1"&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"pink"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/thumb-up-outline-icon&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- solid with color purple --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-solid-icon&lt;/span&gt; &lt;span class="na"&gt;color=&lt;/span&gt;&lt;span class="s"&gt;"purple"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/thumb-up-solid-icon&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- ... with size 36 --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-solid-icon&lt;/span&gt; &lt;span class="err"&gt;...&lt;/span&gt; &lt;span class="na"&gt;size=&lt;/span&gt;&lt;span class="s"&gt;"36"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/thumb-up-solid-icon&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- ... with style  --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-solid-icon&lt;/span&gt; &lt;span class="err"&gt;...&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;"color: green;"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/thumb-up-solid-icon&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;&amp;lt;!-- ... with tailwind class  --&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;thumb-up-solid-icon&lt;/span&gt; &lt;span class="err"&gt;...&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-blue-400"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/thumb-up-solid-icon&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And, all parameters, style, class, color, stroke, and style are reactive, so, you can change the option in realtime by models.&lt;/p&gt;

&lt;p&gt;Play with this in &lt;a href="https://codesandbox.io/s/test-dimaslzng-heroicons-qvbvh"&gt;https://codesandbox.io/s/test-dimaslzng-heroicons-qvbvh&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feel free to join the repository in Github &lt;a href="https://github.com/dimaslz/ng-heroicons"&gt;https://github.com/dimaslz/ng-heroicons&lt;/a&gt;, and, that's it, I hope you find it helpful :), feedback is welcome.&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

</description>
      <category>angular</category>
      <category>heroicons</category>
      <category>library</category>
    </item>
    <item>
      <title>Simulating HTTP responses</title>
      <dc:creator>Dimas López</dc:creator>
      <pubDate>Sat, 28 Mar 2020 05:19:27 +0000</pubDate>
      <link>https://dev.to/dimaslz/simulating-http-responses-1m8l</link>
      <guid>https://dev.to/dimaslz/simulating-http-responses-1m8l</guid>
      <description>&lt;p&gt;Hello!, this is my first post here on dev.to. I am never publishing my codes because is a specific process, it is just for the company or a bit impostor syndrome. But today are different, so let’s do it!.&lt;/p&gt;

&lt;p&gt;First I need to say that as a software developer, I feel super proactive, I am curious to automatize processes in my work, a few lines of codes that are working for you, and are allowing to focus on the most important stuff. For that, I was thinking that a lot of times, I have used scripts or some services to simulate real data coming from the API. This is a super common case when the developer wants to make an example closer to a real use case.&lt;br&gt;
Normally, when you are working in a frontend, the ideal situation, you should have the contract response with your backend team, for example, a list of items, but, sometimes it is not like this, and the frontend team is affected. Or you need to work in a POC, and you are losing time creating the fake files to emulate the API response. To create it, there are a lot of solutions, but I think the most important to highlight is fakerjs and randomuser.me, super useful projects.&lt;/p&gt;

&lt;p&gt;Inspired on these tools, I made a merge in a tool named &lt;a href="https://randomdata.loremapi.io/l/dev.to"&gt;randomdata.loremapi.io&lt;/a&gt;. With randomdata, you can create fake data with the structure schema as you want and paginated as for example, let’s imagine a list of users with the following model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;fullname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;picture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;mobilePhone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;homePhone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you want a list of 50 users, something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;fullname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;picture&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;mobilePhone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;homePhone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;// ... and 49 more&lt;/span&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, for that let’s go to &lt;a href="https://randomdata.loremapi.io"&gt;https://randomdata.loremapi.io&lt;/a&gt; to create this response easily. Once you are on the page, scroll down to the “Random data editor” section and create a schema...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KpQf_mxb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7b627ifkplz591d1ynq1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KpQf_mxb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/7b627ifkplz591d1ynq1.png" alt="Randomdata schema editor" width="513" height="939"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...when you think that the schema is ready, click on the “view data response” button to see the response...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--93s91syo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/vy8f4cuux4nwqxkmss9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--93s91syo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/vy8f4cuux4nwqxkmss9g.png" alt="Randomdata schema response" width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the editor, you have some snippets examples of how to call this schema.&lt;/p&gt;

&lt;p&gt;The benefits are you don’t need locals files as users.js and lose your time creating fake data, just con focus on the UI.&lt;/p&gt;

&lt;p&gt;If you want to follow more examples, visit this codesandbox demo: &lt;a href="https://ssily.codesandbox.io/"&gt;https://ssily.codesandbox.io/&lt;/a&gt;. Here you will find a list of users with full name, year and picture: all in one page, paginate like &lt;code&gt;?page=X&lt;/code&gt; or paginated by offset and limit like &lt;code&gt;?offset=X&amp;amp;limit=X&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tool is an extract of the principal project. At the moment it is totally free until we have done the pending features, but don’t be afraid, the price will be low.&lt;/p&gt;

&lt;p&gt;Thanks for your time to read this, I hope it can be useful to you. Feedback is welcome, ping me on my twitter &lt;a href="https://dev.to@dimaslz"&gt;https://twitter.com/dimaslz&lt;/a&gt; or here in comments.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>api</category>
      <category>http</category>
      <category>frontend</category>
    </item>
  </channel>
</rss>
