<?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>Forem: Diego Chavez</title>
    <description>The latest articles on Forem by Diego Chavez (@diego_chavez_dc).</description>
    <link>https://forem.com/diego_chavez_dc</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%2F644396%2F12c5eecb-6d14-434b-9f7f-f18866f301ec.png</url>
      <title>Forem: Diego Chavez</title>
      <link>https://forem.com/diego_chavez_dc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/diego_chavez_dc"/>
    <language>en</language>
    <item>
      <title>LoopBack 4: NodeJS framework</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Mon, 11 Sep 2023 23:33:43 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/loopback-4-nodejs-framework-b21</link>
      <guid>https://forem.com/diego_chavez_dc/loopback-4-nodejs-framework-b21</guid>
      <description>&lt;p&gt;LoopBack is a web application and API (Application Programming Interfaces) development framework based on Node.js. It was released in December 2018 by IBM and offers a wide range of tools and functionality to facilitate the creation of backend services and applications.&lt;/p&gt;

&lt;p&gt;LoopBack is based on Express.js, another popular Node.js framework, and provides an additional layer of abstraction and functionality to simplify the creation of RESTful APIs. Some of the key features of LoopBack are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Automatic API generation:&lt;/strong&gt; LoopBack allows you to automatically generate RESTful APIs from defined data models. This speeds up the process of creating an API complete with routes, controllers and CRUD (Create, Read, Update, Delete) operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data connectivity:&lt;/strong&gt; LoopBack provides connectors to interact with different data sources, such as SQL and NoSQL databases, RESTful services, file systems and more. This facilitates integration with various technologies and data sources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model management:&lt;/strong&gt; LoopBack provides a set of tools to define and manage data models. Models can include validations, relationships between them and access rules to control security.&lt;br&gt;
Authentication and authorization: LoopBack has a built-in authentication and authorization system to protect APIs and control access to resources. It supports several authentication methods, such as JWT (JSON Web Tokens), OAuth, Passport, among others.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability and extensibility:&lt;/strong&gt; LoopBack is designed to be scalable and extensible. It can handle large volumes of traffic and supports the creation of microservices and distributed architectures.&lt;/p&gt;

&lt;h2&gt;
  
  
  LOOPBACK ARCHITECTURE
&lt;/h2&gt;

&lt;p&gt;The LoopBack framework follows an architecture based on the Model-View-Controller (MVC) pattern. This pattern is widely used in web application development and focuses on the separation of the different responsibilities and functions of an application.&lt;/p&gt;

&lt;p&gt;In LoopBack, the MVC architecture is applied as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Model:&lt;/strong&gt; Models in LoopBack represent the data layer of an application. They are defined as classes or schemas that represent the application's entities, such as users, products, orders, etc. Models define the structure of the data and may include validations, relationships with other models and access rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View:&lt;/strong&gt; In LoopBack, the view refers to the responses that are sent to the client in JSON or HTML format. The view is responsible for presenting the data to the end user, but in the case of a RESTful API, the view can be a JSON object that is sent in response to requests.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Controller:&lt;/strong&gt; Controllers in LoopBack are responsible for handling incoming requests and coordinating interactions between models and views. Controllers contain methods that are executed in response to specific routes or endpoints and are responsible for processing the data, performing operations on the models and sending responses to the client.&lt;/p&gt;

&lt;p&gt;In addition to the MVC pattern, LoopBack also adopts a service-oriented architecture, which means that multiple independent services can be created and connected to build a larger application. This allows the creation of microservices and facilitates the scalability and modularity of the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  ADVANTAGES AND DISADVANTAGES OF USING LOOPBACK 4
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Advantages:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Productivity:&lt;/strong&gt; LoopBack provides a set of tools and functionalities that accelerate application development. Automatic model-driven API generation and simplified data management make it possible to quickly create a complete RESTful API.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexible connectivity:&lt;/strong&gt; LoopBack offers a wide range of connectors to interact with different data sources, such as SQL and NoSQL databases, RESTful services and more. This facilitates integration with external systems and access to different data sources in the same application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customization and extensibility:&lt;/strong&gt; LoopBack allows customizing and extending the framework's behavior to suit specific requirements. LoopBack hooks and middleware provide flexibility to add custom functionality, such as custom authentication and authorization.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation and active community:&lt;/strong&gt; LoopBack has detailed documentation and an active developer community. This makes it easy to find solutions, troubleshoot problems and share knowledge with other LoopBack developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; LoopBack is designed to be scalable, which makes it suitable for applications that handle a high volume of traffic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Disadvantages:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Learning curve:&lt;/strong&gt; Being a robust framework with many features, LoopBack can have a steep learning curve for developers who are new to it. It requires time and effort to become familiar with its concepts and features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unnecessary overhead for simple projects:&lt;/strong&gt; If you are developing a simple web application or a basic API, there may be unnecessary overhead in using LoopBack. Its advanced features and functionality may not be necessary for smaller projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance:&lt;/strong&gt; Although LoopBack is scalable and can handle large volumes of traffic, compared to other lighter weight frameworks, it may have slightly lower performance due to its focus on flexibility and abstraction.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Community dependency and maintenance:&lt;/strong&gt; While LoopBack has an active community and adequate support, community dependency and maintenance continuity are factors to consider. It is important to ensure that there is sufficient ongoing support and updates to the framework over the long term.&lt;/p&gt;




&lt;p&gt;Overall, LoopBack is a powerful choice for backend application development with Node.js, especially when full functionality, fast and advanced data management is required. It provides a wide range of features and an active community that supports its development and maintenance. However, you should evaluate your specific project needs and consider the advantages and disadvantages mentioned above before deciding to use LoopBack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://loopback.io/doc/en/lb4/"&gt;Official Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>framework</category>
      <category>api</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Repository: Laravel design pattern.</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Mon, 03 Jul 2023 18:41:53 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/repository-laravel-design-pattern-2p7d</link>
      <guid>https://forem.com/diego_chavez_dc/repository-laravel-design-pattern-2p7d</guid>
      <description>&lt;p&gt;In Laravel, a commonly used design pattern for working with databases is the Repository. The Repository pattern is used to abstract the data access logic and provide a consistent interface for interacting with the database.&lt;/p&gt;

&lt;p&gt;Next, I will show you a basic example of how you can implement a repository in Laravel:&lt;/p&gt;

&lt;p&gt;1 - Create a new class for your repository. For example, let's create a repository for the entity "User". Run the following command to generate the file:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:repository UserRepository&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will create a file called "UserRepository.php" in the "app/Repositories" directory.&lt;/p&gt;

&lt;p&gt;2 - Open the file "UserRepository.php" and modify it as follows:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In this example, we have created basic methods to find, create, update and delete a user using Laravel's User model. The class constructor accepts an instance of the User model, which is automatically injected through dependency inversion.&lt;/p&gt;

&lt;p&gt;3 - Now, you can use the repository in your controller or other place where you need to interact with the "User" entity. For example, in your controller "UserController.php", you can do the following:&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;In this example, we have injected the &lt;strong&gt;UserRepository&lt;/strong&gt; repository into the &lt;strong&gt;UserController&lt;/strong&gt; controller through dependency inversion in the constructor. Then, we can use the methods of the repository to perform CRUD operations on the "User" entity.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Advantages and Disadvantages of using this design pattern.&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Advantages:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Separation of responsibilities:&lt;/strong&gt; The Repository pattern allows you to separate the data access logic from the business logic of your application. This helps maintain a more organized and coherent code, allowing them to be tested independently, improving modularity and scalability of the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Data source abstraction:&lt;/strong&gt; The repository acts as an abstraction (intermediate) layer between your code and the underlying data source, be it a database, web service or other. This allows you to easily change the data source without directly affecting your business logic. It provides a consistent, abstracted interface for interacting with the data, making it easier to manage and maintain the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flexibility in changing data storage:&lt;/strong&gt; By using a Repository, you can easily change the data storage without affecting the business logic. For example, if you decide to switch from a relational database to a NoSQL database, you will only need to modify the corresponding repository without affecting other parts of the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code reuse:&lt;/strong&gt; By using the Repository pattern, you can encapsulate data access logic in one place. This facilitates code reuse in different parts of your application, reducing code duplication and promoting consistency in the way you interact with data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ease of testing:&lt;/strong&gt; By separating the data access logic into a repository, you can write more effective unit tests, since you can easily simulate repository behaviors and provide test data.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Disadvantages:&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Additional complexity:&lt;/strong&gt; Using the Repository pattern can add an additional layer of complexity to your application. If you have a small or simple application, it may be unnecessary and complicate development.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Increased amount of code:&lt;/strong&gt; When implementing the Repository pattern, you will probably need to write more code to define and maintain repositories. This may increase the amount of code in your project and, consequently, increase development time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Learning curve:&lt;/strong&gt; If you are not familiar with the Repository pattern or have no previous experience with it, it can take time to understand how to implement it correctly in Laravel. This may require additional effort in the learning curve and training of the development team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Possible abstraction overhead:&lt;/strong&gt; If the use of the Repository pattern is applied excessively or incorrectly, it can lead to abstraction overhead. This could result in more complex code to maintain and make it difficult to understand the data access logic.&lt;/p&gt;




&lt;p&gt;In general, the Repository pattern can be beneficial for larger, more complex projects, where a clear separation of responsibilities and greater flexibility in data source management is required. However, in smaller or simpler projects, the use of the Repository pattern may not be necessary and may introduce unnecessary complexity.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>backend</category>
      <category>designpatterns</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>Active Record: Laravel design pattern.</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Tue, 06 Jun 2023 17:48:45 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/active-record-laravel-design-pattern-524c</link>
      <guid>https://forem.com/diego_chavez_dc/active-record-laravel-design-pattern-524c</guid>
      <description>&lt;p&gt;The "Active Record" pattern is not native to Laravel, but can be implemented using Eloquent models, Laravel's built-in ORM (Object-Relational Mapping).&lt;/p&gt;

&lt;p&gt;The Active Record pattern combines business logic and data manipulation in a single class, where each instance of the class represents a row in the database. In Laravel, Eloquent models provide a convenient way to implement this pattern.&lt;/p&gt;

&lt;p&gt;Here is a basic example of how to implement the Active Record pattern in Laravel using Eloquent models:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new model by running the following command in the terminal:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;`php artisan make:model Car`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This will generate a model file in the "app" folder of your Laravel project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the generated model file and make sure that it is in the correct namespace and extends the class &lt;strong&gt;Illuminate\Database\Eloquent\Model.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can now use your model elsewhere in your application to interact with the database. For example, you can create, update, delete or query records.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;This is just a basic example of how you can use the Active Record pattern using Eloquent models in Laravel. You can extend the functionality of your models by adding relationships, validations and business logic as needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages and Disadvantages of using this design pattern.
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Advantages:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Simplicity:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Active Record pattern combines business logic and data manipulation in a single class, which makes code easier to understand and maintain. In Laravel, Eloquent models provide a simple and straightforward implementation of the Active Record pattern.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Direct database access:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Active Record models provide methods and properties to directly access data in the database. This makes it easy to perform CRUD operations (create, read, update, delete) without having to write SQL queries manually without using an additional abstraction layer.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Additional Eloquent features:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Eloquent, Laravel's ORM, offers additional features such as model relationships, methods to perform complex queries, data validation mechanisms and event handling. These functionalities facilitate data manipulation and interaction with the database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Disadvantages:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Coupling:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By combining business logic and data manipulation in a single class, it can generate strong coupling between the data layer and the business layer. This can make reuse and unit testing of business logic difficult, since the models are tightly coupled to the database structure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Limitations in complex cases:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As the complexity of relationships and operations between database objects and tables increases, the Active Record pattern can become limiting. It may require additional logic or custom SQL queries to address more complex cases, which could mean partially abandoning the Active Record pattern. In these cases, it may be necessary to use other techniques, such as the Repository design pattern, to separate data access and business logic responsibilities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Database maintenance:&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If changes are made to the database structure, such as adding or removing columns, modifications may need to be made to the corresponding Active Record patterns. This can be a challenge in large, complex projects where there are multiple models and interdependent relationships.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In summary, the Active Record design pattern in Laravel offers simplicity and direct accessibility to the database, but can lead to coupling and difficulties in more complex situations. In such cases, other design patterns may be preferred, such as the Repository pattern or the Data Mapper pattern, which focus on separation of responsibilities and flexibility in data manipulation. It is important to evaluate the specific needs and characteristics of your project before deciding which design pattern to use.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>backend</category>
      <category>designpatterns</category>
      <category>fullstack</category>
    </item>
    <item>
      <title>What is an API and why is it widely used on the web?</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Wed, 31 May 2023 03:50:32 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/what-is-an-api-and-why-is-it-widely-used-on-the-web-5hf9</link>
      <guid>https://forem.com/diego_chavez_dc/what-is-an-api-and-why-is-it-widely-used-on-the-web-5hf9</guid>
      <description>&lt;p&gt;Being a web developer you must know certain terminologies or processes that are key to the operation and extend your applications to others.&lt;/p&gt;

&lt;p&gt;In this article I will explain in a simple way what an API is and why it is so widely used today on the web, by small, medium and large companies for the correct use of their information.&lt;/p&gt;

&lt;p&gt;An API (Application Programming Interface or Application Programming Interface), is an application that serves as a bridge between data and two or more applications, ie, you can have your database on a separate server and to generate this interface, will end in a URL that will be the output of the information or responses when requested, this URL is known as endpoint, so you can have a web page and a mobile application receiving the same data connected to an API and manage them (depending on the permissions set by the owner) without having to establish different connections directly to the server in applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EK6DQpuz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqg8oe2kc5w27hr46h5c.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EK6DQpuz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sqg8oe2kc5w27hr46h5c.jpg" alt="Architecture of the use of an API" width="597" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An API works through the HTTP protocol, which stands for Hypertext Transfer Protocol, this protocol is the one that defines the syntax and semantics used by the software elements of the web architecture (clients, servers, proxies) to communicate, that is to say, the one that allows us to interact with the content of the web.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common uses of API's
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ho9T8I3T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhh5e5ks2lmvs7qc3qzl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ho9T8I3T--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bhh5e5ks2lmvs7qc3qzl.jpg" alt="Some companies that have their API free for third party applications" width="598" height="355"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Large companies and platforms such as Spotify, Youtube, Facebook, Twitter, Paypal, Shopify have their APIs giving developers permission to certain information allowing them to link it and the end user can obtain certain data from their respective accounts and make use in these applications.&lt;/p&gt;

&lt;p&gt;In e-commerce it is widely used when making purchases that ask us for our credit card information to verify if it is real and we are not inventing it, payments by digital means such as Paypal, access from a mobile application and from the web to the products in our inventory whether we use platforms like Shopify or developed especially for our company.&lt;/p&gt;

&lt;p&gt;Manage information from our own organization or where we work.&lt;/p&gt;

&lt;p&gt;Access applications from our social networks and display information of our liking and entertainment such as: our Spotify playlists, the content we share as twetts, Facebook and Instagram posts.&lt;/p&gt;

&lt;p&gt;In conclusion the use of APIs allow many of us as developers to obtain results in a short time and in a more productive and efficient way allowing us to obtain functionalities in our applications that already exist without having to redo them, hence the comment that perhaps we have heard at some point is not necessary to reinvent the wheel, but to make use of the already developed code that meets the objective or the solution of the problem we are solving.&lt;/p&gt;

&lt;p&gt;In future articles I will be expanding information on the subject of API and HTTP.&lt;/p&gt;

</description>
      <category>api</category>
      <category>backend</category>
      <category>fundaments</category>
    </item>
    <item>
      <title>Javascript: important language for web development.</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Wed, 31 May 2023 03:41:46 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/javascript-important-language-for-web-development-1b5m</link>
      <guid>https://forem.com/diego_chavez_dc/javascript-important-language-for-web-development-1b5m</guid>
      <description>&lt;p&gt;Previously Javascript (JS) was named only to create the interaction between the back-end and front-end client-side, by then the library and tool that constituted the largest percentage and popularity within the language was jquery this because it allowed you to have a cleaner and more organized code in Javascript taking advantage of many features such as the appearance of methods that optimized the code, This library combined with AJAX that allowed to make requests and retrieve information from the server side asynchronously, ie in less execution time and without reloading the URL, was a boom for that time, but it was in 2009 thanks to Ryan Dahl where this technology takes a giant turn in favor of the future we have today, NodeJS arises.&lt;/p&gt;

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

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dPrJsuLB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qe0wmwidy7mkljfkznc6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dPrJsuLB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qe0wmwidy7mkljfkznc6.jpg" alt="nodejs" width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;NodeJS is a JS runtime environment that allows us to run JS code on a machine without the need for a browser.&lt;/p&gt;

&lt;p&gt;It is asynchronous event-driven and designed to develop scalable web applications and sites, with data input and output, where you can create operations that read or write files, manipulate images or handle HTTP requests, among many other things.&lt;/p&gt;

&lt;p&gt;It is based on Google's v8 engine and currently a large part of the web we know today is developed or involves Javascript and the use of this language.&lt;/p&gt;

&lt;p&gt;Its installation is very simple, just go to the official website of NodeJS and download it according to the operating system where we are, whether Windows, Linux or Mac.&lt;/p&gt;

&lt;p&gt;With the installation of NodeJS, the Javascript package manager, npm, is installed by default, which will help you download packages of libraries and useful tools for your development, either on the front-end or back-end side.&lt;/p&gt;

&lt;p&gt;Once installed from the official website the command to verify if it is really on your computer is the following.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;node --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And to verify the npm you use the following.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm --version&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Current TypeScript
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tOcmc0i0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ofjjbvmyrfmqkniby7t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tOcmc0i0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ofjjbvmyrfmqkniby7t.jpg" alt="ts" width="800" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typescript (TS) emerged in 2012 by Microsoft, whose name was originally Strada, was created to correct the structure and shortcomings that still had NodeJS to develop large-scale platforms, although in the tech world many developers consider it as a programming language, TS is a superset of JS.&lt;/p&gt;

&lt;p&gt;It is said that it is superset when you can run applications from another programming language, in the case of TS you can run JS applications because it is at the forefront with the ECMAScript guidelines that govern good practices and new features of JS.&lt;/p&gt;

&lt;p&gt;The benefit of this is that you can implement Typescript code in a Javascript project and vice versa.&lt;/p&gt;

&lt;p&gt;Currently the use of TS is considered important because it allows you to generate more robust applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I particularly like to develop in this language because it can complement and develop hybrid skills on the front-end and back-end side (perhaps one more than the other but we could adapt very quickly), besides being able to have applications with the same technology without having to be combining different programming languages.&lt;/p&gt;

&lt;p&gt;In future articles I will be delving deeper into this excellent JS language and the TS superset.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Error "CSRF token mismatch" on a path that does not require token authorization.</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Wed, 31 May 2023 03:19:31 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/error-csrf-token-mismatch-on-a-path-that-does-not-require-token-authorization-de0</link>
      <guid>https://forem.com/diego_chavez_dc/error-csrf-token-mismatch-on-a-path-that-does-not-require-token-authorization-de0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z6Q397Mn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tk10624dby5r5707dug.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z6Q397Mn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tk10624dby5r5707dug.jpg" alt='Error "CSRF token mismatch" on a path that does not require token authorization.' width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you use Laravel you have probably encountered the following error "CSRF token mismatch".&lt;/p&gt;

&lt;p&gt;Laravel uses CSRF tokens to protect your application from cross-site request forgery attacks.&lt;/p&gt;

&lt;p&gt;If you encounter a "CSRF token mismatch" error, it usually means that the token sent with the request does not match the one expected by Laravel.&lt;/p&gt;

&lt;p&gt;But, if a route does not need a session token, such as a user registration or password retrieval, and you get this error with status 419, how to fix it?&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution:
&lt;/h2&gt;

&lt;p&gt;You can fix the problem by excluding that specific path from CSRF protection in Laravel. To do so, follow these steps:&lt;/p&gt;

&lt;p&gt;1 - Open the file &lt;strong&gt;app/Http/Middleware/VerifyCsrfToken.php&lt;/strong&gt;, and add the path in the &lt;strong&gt;'$except'&lt;/strong&gt; property, as follows:&lt;/p&gt;

&lt;h2&gt;
  
  
  In case it is an API:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;protected $except = [ 'api/path-of-api-user-creation-api', ];&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In case of being an SPA:
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;protected $except = [ '/path-from-api-user-creation-api', ];&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then restart the Laravel server so that it can take the change and that's it.&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>backend</category>
      <category>bug</category>
      <category>csrftoken</category>
    </item>
    <item>
      <title>TIPS FOR DEVELOPERS</title>
      <dc:creator>Diego Chavez</dc:creator>
      <pubDate>Thu, 21 Apr 2022 21:34:25 +0000</pubDate>
      <link>https://forem.com/diego_chavez_dc/tips-for-developers-59j5</link>
      <guid>https://forem.com/diego_chavez_dc/tips-for-developers-59j5</guid>
      <description>&lt;p&gt;In any profession or area in which we work technical knowledge is not everything, it plays a fundamental role in the profession but something else that plays a great role is our own emotional intelligence, in my case of being a developer of systems and web interfaces our main objective is to solve problems or improve the user experience with our work but when we reach a point of seeing so much code or even fatigue can block us mentally and hinder us to think better, or simply our own personal life, because despite everything we are still human, sons, brothers, boyfriends, fathers, uncles and aunts among others. For that, we need to develop great emotional intelligence.&lt;/p&gt;

&lt;p&gt;In this post I bring you some recommended tips that little by little in my experience as a developer I have been carried out in some situations and have helped me a lot, for this you need to develop the following:&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;1. Mental Toughness.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is the mental strength, it is the degree that allows you to withstand any emotional problem and not let it affect you. You need to do activities that make you mentally tough. Things you think you can't do. Tasks that cause you difficulties, but that you overcome with hard work and determination.&lt;/p&gt;

&lt;p&gt;To do this, do physical exercise, try something that you like so much.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vbR301gm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxnxt66qc9858e5o30wj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vbR301gm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dxnxt66qc9858e5o30wj.png" alt="Mental toughness" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;2. Mental Consciousness.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is the ability to see your thoughts as you have them, to be able to look at yourself from a third person point of view. The key fact is that you must realize that we experience emotions due to a reaction or event.&lt;/p&gt;

&lt;p&gt;For this meditation, visualization, self-analysis give you an insight into your own thoughts.&lt;/p&gt;

&lt;p&gt;Visualization and meditation helps you to know what you are thinking to understand how you are feeling at that moment.&lt;/p&gt;

&lt;p&gt;Self-analysis you can see what your thoughts have been over a period of time to see where the focus has gone. Doing these activities will make you more present and help you notice those emotions in real time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iyC2wLBJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnhj1tcxxq2qgfacfo0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iyC2wLBJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tnhj1tcxxq2qgfacfo0q.png" alt="Mental Consciousness" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;3. Mental Attitude.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It is the ability to maintain a positive attitude despite a negative circumstance thrown in your direction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--geXnoC8z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfpc2jym673bwoctr3j6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--geXnoC8z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfpc2jym673bwoctr3j6.png" alt="Mental Attitude" width="800" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are a negative person, then a negative situation will affect you longer and worse than someone who is a positive person, the reason being that the negative person will magnify the problem by focusing on their negative perception of the problem, whereas the positive person will spend time trying to find the benefit they can get out of the situation.&lt;/p&gt;

&lt;p&gt;We want the positive person to find solutions without focusing on the problems.&lt;/p&gt;

&lt;p&gt;To do this, it can help to do things like visualize positive goals and circumstances in your life.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;strong&gt;4. Set aside time for yourself.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You should set aside time to do what you enjoy the most, whether it is reading a book, going to the movies with your family, alone or with friends, going for a walk in a different place that makes you get out of the ordinary, the idea is that you can set aside that time for you to do something different that makes you recharge your energy, clear and free your mind to think better later.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ua8_UCC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toco5pmm3grbgtxnqj1x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ua8_UCC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/toco5pmm3grbgtxnqj1x.png" alt="Yourself" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>developers</category>
      <category>skills</category>
    </item>
  </channel>
</rss>
