<?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: webdeasy.de</title>
    <description>The latest articles on DEV Community by webdeasy.de (@webdeasy).</description>
    <link>https://dev.to/webdeasy</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%2F172865%2F8a39acb2-543c-4fe5-973f-5808e2308a28.png</url>
      <title>DEV Community: webdeasy.de</title>
      <link>https://dev.to/webdeasy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/webdeasy"/>
    <language>en</language>
    <item>
      <title>GitHub Actions: Quickstart-Guide for every Developer!🚀</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Tue, 05 Nov 2024 16:04:29 +0000</pubDate>
      <link>https://dev.to/webdeasy/github-actions-quickstart-guide-for-every-developer-4a99</link>
      <guid>https://dev.to/webdeasy/github-actions-quickstart-guide-for-every-developer-4a99</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;In this Quickstart guide, I want to introduce you to GitHub Actions and show you how you can use GitHub Actions to create CI/CD pipelines to automate boring, repetitive tasks.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GitHub Actions is a versatile tool that developers can use to organise their software development processes more efficiently. You can mainly use GitHub Actions as a CI/CD pipeline (CI = Continuous Integration, CD = Continuous Delivery) and is therefore comparable with &lt;a href="https://www.jenkins.io/" rel="noopener noreferrer"&gt;Jenkins&lt;/a&gt;, &lt;a href="https://circleci.com/" rel="noopener noreferrer"&gt;CircleCI&lt;/a&gt; or &lt;a href="https://azure.microsoft.com/de-de/products/devops" rel="noopener noreferrer"&gt;Azure DevOps&lt;/a&gt;, for example.&lt;/p&gt;

&lt;p&gt;I myself actually use GitHub Actions in every repo that I have created in GitHub. For example, to deploy changes in this blog or as a complete &lt;a href="https://webdeasy.de/en/what-is-ci-cd/" rel="noopener noreferrer"&gt;CI/CD pipeline&lt;/a&gt; for my &lt;a href="https://jscodebox.com/" rel="noopener noreferrer"&gt;JavaScript Challenge platform&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is GitHub Actions?
&lt;/h2&gt;

&lt;p&gt;GitHub Actions is a powerful automation tool that is directly integrated into GitHub and enables developers to create automated workflows for their software development projects. GitHub Actions can be used to set up CI/CD pipelines, run tests, analyse code and much more. It offers a flexible and customisable way to automate development processes by combining different actions and workflows.&lt;/p&gt;

&lt;p&gt;To be more precise, you can actually do anything you can think of: Execute unit tests, deploy to a &lt;a href="https://webdeasy.de/en/docker-vs-virtual-machines/" rel="noopener noreferrer"&gt;VM&lt;/a&gt;, deploy to a Kubernetes cluster, create/build apps, deploy to various services of all common cloud providers, code security scans, etc. This list can be extended almost endlessly 😉&lt;/p&gt;

&lt;p&gt;A workflow in GitHub Actions consists of one or more actions that are executed as steps in a defined sequence. These workflows are defined in YAML files and saved in the &lt;code&gt;.github/workflows&lt;/code&gt; directory of the repository.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F05%2Fbeispiel-pipeline.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F05%2Fbeispiel-pipeline.jpg" alt="GitHub Actions – CD-Pipeline of webdeasy.de" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The screenshot is the result of executing the GitHub Actions Workflow of this blog, whereby changes in the repository are automatically rolled out on the production server. If an error occurs, a rollback to the last stable version is performed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And what does the fun cost me?&lt;/strong&gt; &lt;u&gt;Nothing!&lt;/u&gt; GitHub provides the service for public repos completely free of charge and there is also a &lt;a href="https://github.com/features/actions#pricing-details" rel="noopener noreferrer"&gt;generous free quota&lt;/a&gt; for private repositories, which lasts for quite a while and resets every month.&lt;/p&gt;
&lt;h2&gt;
  
  
  Creating a GitHub Actions Workflow
&lt;/h2&gt;

&lt;p&gt;To create a new GitHub actions workflow, you can simply use the ‘Actions’ tab in your GitHub repo or alternatively create a YAML file in the path &lt;code&gt;.github/workflows&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcav42evb53mhs1j3iwe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpcav42evb53mhs1j3iwe.jpg" alt="GitHub Actions Tab" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To understand how a workflow in GitHub Actions is structured, I have a very simple CI pipeline for you here, which I will explain step by step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CI Pipeline&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check out repository&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Set up Node.js&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v2&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;20'&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install dependencies&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm install&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run tests&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What exactly happens here? The pipeline is triggered every time a push is executed in the repository. You can find out more about triggers and events later in this GitHub Actions tutorial. Let’s go through the steps one by one:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Check out repository: This step checks out the code in the repository.&lt;/li&gt;
&lt;li&gt;Set up Node.js: Deploys &lt;a href="https://webdeasy.de/en/node-js-tutorial-en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; version 20 in the current environment.&lt;/li&gt;
&lt;li&gt;Install dependencies: Executes the &lt;code&gt;npm install&lt;/code&gt; command to install the project dependencies.&lt;/li&gt;
&lt;li&gt;Run tests: Executes the &lt;code&gt;npm test&lt;/code&gt; command to run the tests of the project.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This example shows you the basic structure of a pipeline. You can execute any number of steps and jobs per GitHub Actions workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Triggers &amp;amp; Events
&lt;/h2&gt;

&lt;p&gt;GitHub Actions provides a flexible way to execute workflows based on various triggers and events. These triggers determine when a workflow is started and can respond to a variety of GitHub events, such as code changes, issues and schedules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code changes/new commits on a specific branch:&lt;/strong&gt;&lt;br&gt;
This workflow is only executed when a commit is pushed to the develop branch.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;develop&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tags that correspond to a specific pattern:&lt;/strong&gt;&lt;br&gt;
Here, the workflow is only started if a tag beginning with &lt;code&gt;release-&lt;/code&gt; (e.g. &lt;code&gt;release-1.0.0&lt;/code&gt;) is pushed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;release-*'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Regular execution:&lt;/strong&gt;&lt;br&gt;
This workflow is executed every Monday at 12 noon.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;schedule&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;cron&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;12&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;1'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is also very useful to carry out tests and linting, for example, before a pull request can be confirmed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F05%2Fpr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F05%2Fpr.jpg" alt="GitHub Pull Request: Executing a workflow" width="800" height="548"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub Marketplace
&lt;/h2&gt;

&lt;p&gt;You don’t have to programme all actions yourself. That’s why the &lt;a href="https://github.com/marketplace" rel="noopener noreferrer"&gt;GitHub Marketplace&lt;/a&gt; is a central point of contact for predefined actions that you can integrate into your workflows to speed up and simplify the development process. Here you will find a variety of actions created by the community and GitHub itself to automate common tasks such as testing, code analysis and much more.&lt;/p&gt;

&lt;p&gt;Suppose you want to use an action that automatically checks your code for formatting errors. A popular action for this purpose is the Prettier action, which formats the code with Prettier.&lt;/p&gt;

&lt;p&gt;Here is an example of how you can integrate this action into your workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Format Code&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Check out repository&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run Prettier&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;creyD/prettier_action@v3.3&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;prettier_options&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;--write **/*.js&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This workflow is executed for every push and pull request and checks whether the JavaScript code is formatted correctly. The &lt;code&gt;prettier_action&lt;/code&gt; is integrated from the GitHub Marketplace and configured with the desired options.&lt;/p&gt;

&lt;p&gt;Using the GitHub Marketplace offers considerable advantages, such as time savings, as you have immediate access to numerous ready-made actions without having to develop your own solutions. In addition, the regular maintenance and updating of the actions ensures high quality and security. Thanks to the support of the GitHub community, you benefit from constantly improved and new actions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other useful actions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/github/codeql-action" rel="noopener noreferrer"&gt;CodeQL Analysis&lt;/a&gt;:&lt;/strong&gt; Automate code analysis to detect security vulnerabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/snyk/actions" rel="noopener noreferrer"&gt;Snyk Vulnerability Scan&lt;/a&gt;:&lt;/strong&gt; Automated scan of your code for security vulnerabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/marketplace/actions/build-and-push-docker-images" rel="noopener noreferrer"&gt;Docker Build and Publish&lt;/a&gt;:&lt;/strong&gt; Create and publish &lt;a href="https://webdeasy.de/en/docker-init-command/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; images directly from your workflow.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://github.com/marketplace/actions/slack-notify" rel="noopener noreferrer"&gt;Slack Notifications&lt;/a&gt;:&lt;/strong&gt; Send notifications to Slack channels to inform your team about the status of workflows.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GitHub Actions Best Practices
&lt;/h2&gt;

&lt;p&gt;If you use GitHub Actions, I think there are a few best practices that you should follow. This can save you execution time and increase the security of your workflows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Use secrets and variables:&lt;/strong&gt; Use secrets and environment variables to securely manage sensitive data such as API keys or access data. Store this information in the repository without saving it directly in the code to minimise security risks (can be found in the repo settings under ‘Secrets and variables’).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimise runtime:&lt;/strong&gt; Optimise the runtime of your workflows by avoiding unnecessary steps and using caching techniques. This reduces the execution time and resource load, making your workflows more efficient.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Monitor workflows:&lt;/strong&gt; Monitor your workflows regularly to avoid unexpected errors. If a workflow fails, you will even be notified automatically by email. So keep an eye on your inbox too.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay attention to the versioning of actions:&lt;/strong&gt; Make sure to use specific versions of actions to ensure that changes or updates do not cause unexpected problems in your workflow. Use fixed version numbers instead of ‘latest’ to ensure consistency.&lt;/li&gt;
&lt;li&gt;*&lt;em&gt;Keep actions small: *&lt;/em&gt; Keep your actions small and specific to increase maintainability and reusability. A modular structure makes debugging easier and allows you to update individual components quickly if necessary.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use the GitHub Marketplace:&lt;/strong&gt; Access the GitHub Marketplace to find predefined actions and integrate them into your workflows. This saves time and effort, as you can access tested and reliable solutions instead of creating your own actions from scratch.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;As you can see, GitHub Actions is extremely flexible. Setting up a new workflow is sometimes a little time-consuming, but it saves time and nerves in the long run, as you save yourself repetitive tasks and thus avoid mistakes. To get started, I recommend the &lt;a href="https://docs.github.com/en/actions/writing-workflows/quickstart" rel="noopener noreferrer"&gt;Quickstart Guide&lt;/a&gt;, directly from GitHub.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;&lt;em&gt;Some texts were created with the help of AI. All content has been thoroughly checked!&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>githubactions</category>
      <category>devops</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Rest API Testing: How to test Rest APIs properly!</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Wed, 07 Aug 2024 08:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/rest-api-testing-how-to-test-rest-apis-properly-1bh6</link>
      <guid>https://dev.to/webdeasy/rest-api-testing-how-to-test-rest-apis-properly-1bh6</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Rest API testing is one of the most important tasks when developing reliable and secure Rest APIs. Here you will find a complete overview of everything you should consider when testing your Rest API.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are countless ways to test a Rest API. The procedure depends, for example, on the application, the programming language and the development team. However, there are a few basic things you should always bear in mind. And that's exactly what this blog post is about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why you should test your Rest API
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;An API is like a contract&lt;/strong&gt; between a client and a server or between two applications. Before testing the implementation, it must be ensured that the contract is correct by checking the specification (e.g. &lt;a href="https://swagger.io/" rel="noopener noreferrer"&gt;Swagger&lt;/a&gt; or &lt;a href="https://www.openapis.org/" rel="noopener noreferrer"&gt;OpenAPI&lt;/a&gt;). For Rest APIs, it is important that all &lt;a href="https://www.assets.dpunkt.de/leseproben/13265/4_Kapitel%208%20-%20Grundlagen%20RESTful%20HTTP.pdf" rel="noopener noreferrer"&gt;HTTP REST semantics&lt;/a&gt; and principles are adhered to. This is all the more important for publicly accessible APIs so that all functionalities can continue to be guaranteed after updates.&lt;/p&gt;

&lt;p&gt;Security checks are an essential part of the testing process. By testing, you can uncover and close potential security gaps to protect your application from attacks. Another important aspect is optimising performance. Through testing, you can measure the response times of your API and ensure that it remains fast and reliable even under high load. In this way, bottlenecks and performance problems can be recognised and rectified at an early stage.&lt;/p&gt;

&lt;p&gt;Last but not least, testing enables the integration of your API into a &lt;a href="https://webdeasy.de/en/what-is-ci-cd/" rel="noopener noreferrer"&gt;Continuous Integration and Deployment (CI/CD)&lt;/a&gt; pipeline, which automatically checks changes to the code and ensures continuous quality assurance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Selection of the optimal test cases
&lt;/h2&gt;

&lt;p&gt;Before we can start writing the tests, I would like to briefly explain how to select the right test cases. This is actually the most important task. Otherwise we can write a hundred tests, none of which add any value. We need to think particularly carefully about edge cases. Edge cases are test inputs that are most likely to trigger a faulty output or even a programme error.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: There are different types of tests, e.g. integration tests, unit tests or functional tests. Various tests are shown in this blog post, but I will not go into the differentiation of the test types in detail.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;To make the selection a little clearer, I have come up with a case study. These are our requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We want to create a function to register a user (/sign-up route)&lt;/li&gt;
&lt;li&gt;Username, password and password repetition should be queried&lt;/li&gt;
&lt;li&gt;The user name must not yet be assigned&lt;/li&gt;
&lt;li&gt;The user should receive an e-mail to complete the registration (double opt-in)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a little logical thought, the following test cases come to mind first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have all parameters (user name, password, password repetition) been transferred?&lt;/li&gt;
&lt;li&gt;Does the user name already exist in the database?&lt;/li&gt;
&lt;li&gt;Has the confirmation e-mail been sent?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is all correct, but we have forgotten a few more. And these are the so-called marginal cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods" rel="noopener noreferrer"&gt;HTTP request method&lt;/a&gt; correct?&lt;/li&gt;
&lt;li&gt;Have all required parameters been transferred in the correct format?&lt;/li&gt;
&lt;li&gt;Do the password and password repetition match?&lt;/li&gt;
&lt;li&gt;Is the password length sufficient?&lt;/li&gt;
&lt;li&gt;Could the database query be executed without errors?&lt;/li&gt;
&lt;li&gt;Are the correct &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status" rel="noopener noreferrer"&gt;HTTP status codes&lt;/a&gt; returned in the event of an error?&lt;/li&gt;
&lt;li&gt;Is the user name not too long for the database field (e.g. if VARCHAR is limited to 255 characters)?&lt;/li&gt;
&lt;li&gt;Has a valid token been created for the double opt-in and successfully saved in the database?&lt;/li&gt;
&lt;li&gt;Are the entries &lt;a href="https://webdeasy.de/en/website-security-tips/" rel="noopener noreferrer"&gt;XSS and SQL injection-proof&lt;/a&gt;?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The aim is to look at the enquiry from a different angle in order to cover as many edge cases as possible. I hope that I can sensitise you to this with this example.&lt;/p&gt;

&lt;p&gt;Take your time to select the test cases. This is more important than writing the tests. Once you have done this correctly, you will save yourself a lot of time in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rest API Testing Tools
&lt;/h2&gt;

&lt;p&gt;There are numerous tools for testing Rest APIs. There are tools with which we can execute HTTP requests directly or tools with which we can write unit tests and thus test our Rest API. These are my two favourite ways:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.postman.com/downloads/" rel="noopener noreferrer"&gt;&lt;strong&gt;Postman&lt;/strong&gt;&lt;/a&gt;: Postman is a widely used tool that provides an intuitive user interface for testing and debugging Rest APIs. With Postman, you can quickly and easily create, test and save API requests. It is easy to use and working with multiple developers on the same resources works great.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unit Testing&lt;/strong&gt;: Yes, Rest APIs can also be tested using unit tests. This involves executing the HTTP requests and validating the result. Although this method initially requires more effort, it offers the advantage of complete integration into your development process and enables continuous testing. Each programming language has its own tools. I mainly develop with JavaScript, so I can show you a practical example here. I use &lt;a href="https://www.npmjs.com/package/mocha" rel="noopener noreferrer"&gt;Mocha&lt;/a&gt; and &lt;a href="https://www.npmjs.com/package/chai" rel="noopener noreferrer"&gt;Chai&lt;/a&gt; as testing frameworks. For each test, one or more requests are sent to the corresponding Rest API endpoints and the result is validated.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chai&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chai&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;chaiHttp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;chai-http&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../../index&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;should&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;chai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;should&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;chai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chaiHttp&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nf"&gt;describe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;## Entries - Test entry functionalities&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="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;listId&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// authenticate user before running tests&lt;/span&gt;
  &lt;span class="nf"&gt;before&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should be able to create a new entry&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Test entry&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="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;listId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;be&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;id&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;listID&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;property&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;checked&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// checked should be false by default&lt;/span&gt;
        &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nf"&gt;done&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shouldn't be able to create a new entry if the list does not exist&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Test entry&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unrealisticListId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9999999&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;unrealisticListId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;done&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shouldn't be able to create a new entry if the name is not provided&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;

    &lt;span class="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;listId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Missing name property&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nf"&gt;done&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should be able to get all entries for a list&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;listId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;be&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;be&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;a&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;array&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="nf"&gt;done&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;shouldn't be able to get all entries for a list if the list does not exist&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;unrealisticListId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9999999&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;unrealisticListId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;eql&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;List not found&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nf"&gt;done&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="nf"&gt;it&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;should be able to update the properties of an entry&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="nx"&gt;done&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;entry&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Default name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;

    &lt;span class="c1"&gt;// create a new entry&lt;/span&gt;
    &lt;span class="nx"&gt;chai&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;listId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/entries`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;createdEntryId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// update the entry&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;changedName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Changed entry name&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;changedName&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;priority&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="c1"&gt;// send the patch request&lt;/span&gt;
        &lt;span class="nx"&gt;chai&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;patch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/entries/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;createdEntryId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
          &lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;entry&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
          &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;be&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="c1"&gt;// check if the name has changed&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;changedName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="c1"&gt;// check if the checked state has changed&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;checked&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="c1"&gt;// check if the priority has changed&lt;/span&gt;
            &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;priority&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;99&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

            &lt;span class="c1"&gt;// delete the entry&lt;/span&gt;
            &lt;span class="nx"&gt;chai&lt;/span&gt;
              &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;request&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="s2"&gt;`/api/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;API_VERSION&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/list/entries/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;createdEntryId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
              &lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Authorization&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
              &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;end&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;should&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="nf"&gt;done&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="p"&gt;});&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;There are similar tools in other programming languages. Here are a few more common tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://junit.org/junit5/" rel="noopener noreferrer"&gt;&lt;strong&gt;JUnit&lt;/strong&gt;&lt;/a&gt;: A popular framework for testing Java applications. It is ideal for creating unit tests for rest APIs in Java.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://rest-assured.io/" rel="noopener noreferrer"&gt;&lt;strong&gt;RestAssured&lt;/strong&gt;&lt;/a&gt;: A DSL-based Java tool developed specifically for testing Rest APIs. It provides a simple and expressive syntax for validating API requests and responses.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.pytest.org/en/8.2.x/" rel="noopener noreferrer"&gt;&lt;strong&gt;PyTest&lt;/strong&gt;&lt;/a&gt;: A well-known Python framework for writing unit tests in Python.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Rest API Tests in Postman
&lt;/h2&gt;

&lt;p&gt;Postman is one of my favourite tools for testing Rest APIs. I would therefore like to show you in more detail how you can create tests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Organise requests in Postman
&lt;/h3&gt;

&lt;p&gt;If you have installed Postman, this interface awaits you. You should create a separate collection for each project/rest API. This is like a folder in which you can organise your individual requests. In addition, you can then execute the tests for all the requests it contains with a single click.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fpostman.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fpostman.jpg" alt="Postman - Create collection"&gt;&lt;/a&gt;&lt;br&gt;
We can then create any number of requests per collection. I have highlighted the most important settings in red.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Frequest.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Frequest.jpg" alt="Structure of an HTTP request"&gt;&lt;/a&gt;&lt;br&gt;
Firstly, we should give our request a name so that it can be recognised quickly (‘Login’ in this case). This also appears on the left in the collection menu.&lt;/p&gt;

&lt;p&gt;Next, we can set the corresponding HTTP request method for each request and specify the exact URL of the Rest API route to be checked.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tip&lt;/strong&gt;: You should create recurring data such as the base URL (&lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;) as &lt;a href="https://learning.postman.com/docs/sending-requests/variables/variables/" rel="noopener noreferrer"&gt;variables&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On the far right you will find the ‘Send’ button to send an enquiry directly.&lt;/p&gt;
&lt;h2&gt;
  
  
  Transfer body data
&lt;/h2&gt;

&lt;p&gt;In many cases, we want to send data to the Rest API. We can either do this via the ‘Params’ tab. These are then transmitted to the server according to the HTTP request method or we use the ‘Body’ tab to transmit data in other data formats.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://webdeasy.de/en/using-json-in-javascript-and-php/" rel="noopener noreferrer"&gt;JSON&lt;/a&gt; is often used on the web as it is very flexible and can be used to transfer complex data structures. It is important that you select ‘raw’ above the text field and then select the ‘JSON’ format to the right of it. Otherwise the data may not be transferred correctly.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fbody.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fbody.jpg" alt="Pass body parameter in Postman"&gt;&lt;/a&gt;&lt;br&gt;
The data can now be transferred to the large text field in JSON format.&lt;/p&gt;

&lt;p&gt;This can look like this, for example. Postman shows you errors in the JSON structure directly. However, you can test it more precisely with this &lt;a href="https://jsonformatter.curiousconcept.com/" rel="noopener noreferrer"&gt;JSON validator&lt;/a&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="nl"&gt;"username"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"webdeasy.de"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"password"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"f00b4r"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"password_repeat"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"foob4r"&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;Whether you use URL parameters or body data depends entirely on the implementation of your Rest API. This is how you access it in Node.js:&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="nx"&gt;router&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/sign-up&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="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// body data&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;YOURDATA&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// url parameters&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;YOURPARAM&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;h3&gt;
  
  
  Insert Authorisation Keys
&lt;/h3&gt;

&lt;p&gt;If you have implemented a login with &lt;a href="https://webdeasy.de/en/node-js-login-with-express-jwt-mysql#login" rel="noopener noreferrer"&gt;Bearer Token&lt;/a&gt;, you can transfer this in the ‘Authorisation’ tab. To do this, select ‘Bearer Token’ and enter it on the right under ‘Token’.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fauthorization.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Fauthorization.jpg" alt="Authorisation - Transfer Bearer Token"&gt;&lt;/a&gt;&lt;br&gt;
For other authentication methods, you can select the appropriate one under ‘Type’.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tip: You can find your last queries under the ‘History’ menu item.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Programming test cases in Postman
&lt;/h3&gt;

&lt;p&gt;We have entered and clearly structured the individual routes. You can now execute and test them using the ‘Send’ button. However, you always have to check all results manually. It is easier if a script takes over the task for us. We can do this under the ‘Tests’ tab.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Ftesting.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Ftesting.jpg" alt="Create test cases with Postman"&gt;&lt;/a&gt;&lt;br&gt;
Here you have the opportunity to programme your test cases, which is easier than it sounds at first.&lt;/p&gt;

&lt;p&gt;We can use the following code to query the correct status code:&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="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Status test&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&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;It can be that simple. What you will also often need is to query a response header variable. Here I check whether the response is an image of the type ‘jpeg’:&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="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type is image/jpeg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;have&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;be&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;header&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;image/jpeg&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Tip: On the right-hand side under ‘Snippets’ you can click to insert ready-made tests.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;More detailed documentation on creating test cases is available directly at &lt;a href="https://learning.postman.com/docs/tests-and-scripts/write-scripts/test-scripts/" rel="noopener noreferrer"&gt;learning.postman.com&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Execute tests automatically
&lt;/h3&gt;

&lt;p&gt;We have created our test cases manually. However, to save us some time, we can run all the tests together in a collection. To do this, select the collection and click on ‘Run’. You can then set the number of iterations (executions) and other points.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Frun-test.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Frun-test.jpg" alt="Execute collection test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will then receive a detailed test log and can rectify errors in the code directly and run the test again.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Ftest-passed.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2021%2F04%2Ftest-passed.jpg" alt="Test protocol of the two tests"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Automatic Rest API Tests in a CI/CD pipeline
&lt;/h2&gt;

&lt;p&gt;It is a good and popular practice to run tests directly from a CI/CD pipeline. As a result, many errors are seen directly when the code is checked into the repo and can be rectified. In the best case, before everything is deployed to production.&lt;/p&gt;

&lt;p&gt;The following code is an excerpt from a GitHub Actions workflow file, in which tests of a Node.js backend are executed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Execute Unit Tests&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;develop"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;

    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;20.x&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Use Node.js ${{ matrix.node-version }}&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v3&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.node-version }}&lt;/span&gt;
        &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install dependencies and run tests&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;npm install&lt;/span&gt;
        &lt;span class="s"&gt;npm run test&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;CI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# set environment variable to run tests in CI mode&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Cool, right? I’ve created a detailed blog post explaining &lt;a href="https://webdeasy.de/en/github-actions-tutorial-en/" rel="noopener noreferrer"&gt;how to create CI/CD pipelines with GitHub Actions&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Testing Rest APIs is an important step in ensuring the quality and performance of the application. By carefully selecting test cases and using different test methods, potential problems can be recognised and rectified at an early stage. Integration into your CI/CD pipeline enables continuous review, while adherence to the API specification ensures contract compliance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If you liked this tutorial, I would be grateful if you would check out my other articles on my &lt;a href="https://webdeasy.de/en/topics/" rel="noopener noreferrer"&gt;blog webdeasy.de&lt;/a&gt;&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;p&gt;&lt;small&gt;&lt;em&gt;Some texts were created with the help of AI. All content has been thoroughly checked!&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;

</description>
      <category>restapi</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>GitHub Container Registry: How to push Docker images to GitHub 🐋</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Thu, 11 Jul 2024 10:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/github-container-registry-how-to-push-docker-images-to-github-5bk4</link>
      <guid>https://dev.to/webdeasy/github-container-registry-how-to-push-docker-images-to-github-5bk4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The GitHub Container Registry allows you to publish or host private and public Docker images. You can find out everything you need to know in this tutorial.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With its registry service &lt;strong&gt;GitHub Packages&lt;/strong&gt;, GitHub provides a way for developers to host their own Docker images directly in GitHub. In my opinion, the name of GitHub is somewhat misleading: the umbrella term for the service is GitHub Packages. It contains a number of registries. These include the &lt;strong&gt;Docker Registry&lt;/strong&gt;, which has been renamed the &lt;strong&gt;Container Registry&lt;/strong&gt; in order to host all types of containers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fgithub-packages.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fgithub-packages.png" alt="GitHub Packages Structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not use Docker Hub? 🐋
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt; is the first port of call when it comes to Docker images – no question about it. In the free version, however, only one private image is available to each account and the number of pulls (200 pulls per 6 hours) is also limited. And this is where the GitHub Container Registry comes into play! 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  Push Docker Images into the GitHub Registry
&lt;/h2&gt;

&lt;p&gt;To create a Docker image, we need a Docker image, which we have to create with a Dockerfile. You can create such a Dockerfile using the &lt;a href="https://webdeasy.de/en/docker-init-command/" rel="noopener noreferrer"&gt;docker init command&lt;/a&gt;, for example. Once the file is available, we can build the image:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t frontend .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-build.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-build.jpg" alt="Screenshot from the Docker build process"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the next step, we need to log in to the GitHub Container Registry. To do this, we need a personal access token from GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate Personal Access Token (PAT)
&lt;/h3&gt;

&lt;p&gt;To generate a new PAT, navigate to &lt;strong&gt;GitHub Settings &amp;gt; Developer seettings &amp;gt; Personal access tokens &amp;gt; Tokens (classic)&lt;/strong&gt; and create a new token. You must select &lt;strong&gt;“write:packages”&lt;/strong&gt; and** “read:packages”** as the scope. You can adjust the duration of the token to your project or set it to unlimited.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fpat-1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fpat-1.jpg" alt="Create GitHub Personal Access Token (PAT)"&gt;&lt;/a&gt;&lt;br&gt;
You should save the token, e.g. in your &lt;a href="https://webdeasy.de/en/password-manager/" rel="noopener noreferrer"&gt;password manager&lt;/a&gt;. If you lose the token, you will have to regenerate it.&lt;/p&gt;

&lt;p&gt;Now open a terminal on your computer and set your PAT in a variable (replace &lt;code&gt;&amp;lt;YOUR_PAT&amp;gt;&lt;/code&gt; with your token):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Set PAT into a variable
export GH_PAT=&amp;lt;YOUR_PAT&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To log in to the GitHub Container Registry (ghcr.io), use the following command (replace &lt;code&gt;&amp;lt;USERNAME&amp;gt;&lt;/code&gt; with your GitHub username).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Login to the GitHub Container Registry using your PAT
echo $GH_PAT | docker login ghcr.io -u &amp;lt;USERNAME&amp;gt; --password-stdin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the PAT and your user name were correct, you should receive the message “Login Succeeded”.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-login-ghcr.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-login-ghcr.jpg" alt="Successful Docker login to the GitHub Container Registry (ghcr.io)"&gt;&lt;/a&gt;&lt;br&gt;
Next, we tag the image so that it also ends up in the correct registry. Replace &lt;code&gt;&amp;lt;USERNAME&amp;gt;&lt;/code&gt; with your GitHub username, &lt;code&gt;&amp;lt;IMAGE_NAME&amp;gt;&lt;/code&gt; with the desired name of the image and &lt;code&gt;&amp;lt;TAG&amp;gt;&lt;/code&gt; with the desired tag (default: &lt;code&gt;latest&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;# Tag the builded docker image
docker tag frontend ghcr.io/&amp;lt;USERNAME&amp;gt;/&amp;lt;IMAGE_NAME&amp;gt;:&amp;lt;TAG&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we can push the image into the registry. Here you have to replace the same variables as when tagging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker push ghcr.io/&amp;lt;USERNAME&amp;gt;/&amp;lt;IMAGE_NAME&amp;gt;:&amp;lt;TAG&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have done everything correctly, you should receive such an output or no error message 😉&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-ghcr-push.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fdocker-ghcr-push.jpg" alt="GitHub Docker Regsitry: Tagging and pushing Docker images"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Congratulations! You have successfully pushed your first Docker image to the GitHub registry!&lt;/em&gt; 🎉&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fgithub-packages.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fgithub-packages.jpg" alt="GitHub Packages"&gt;&lt;/a&gt;&lt;br&gt;
On this page you now have further options, such as changing the visibility or deleting the image.&lt;/p&gt;
&lt;h2&gt;
  
  
  Pulling GitHub Docker Images
&lt;/h2&gt;

&lt;p&gt;Of course, you can now also use your Docker images from the registry. The path is the same as for pushing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker pull ghcr.io/&amp;lt;USERNAME&amp;gt;/&amp;lt;IMAGE_NAME&amp;gt;:&amp;lt;TAG&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  GitHub Actions Workflow for Docker Images in the GitHub Registry
&lt;/h2&gt;

&lt;p&gt;Pushing Docker images manually is daft! That’s why there are &lt;a href="https://webdeasy.de/en/what-is-ci-cd/" rel="noopener noreferrer"&gt;CI/CD pipelines&lt;/a&gt; that we can implement with &lt;a href="https://webdeasy.de/en/github-actions-tutorial-en/" rel="noopener noreferrer"&gt;GitHub Actions&lt;/a&gt;, for example. For certain events, e.g. a new commit, we can automatically build the Docker image and publish it in the registry. In the following example, a Docker image is built and published when the frontend branch is pushed. Building and publishing is already done after the “Build and push Docker image” step. However, I have left the last two steps in for the sake of completeness, as this is a workflow of one of my projects and you may also have a use case for it 😉&lt;/p&gt;

&lt;p&gt;In your GitHub repository, you can simply create a file under &lt;code&gt;.github/workflows/cd.yml&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Continuous Deployment - Frontend&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;frontend'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;REGISTRY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ghcr.io&lt;/span&gt;
  &lt;span class="na"&gt;IMAGE_NAME&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.repository }}&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build-and-push-image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;read&lt;/span&gt;
      &lt;span class="na"&gt;packages&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;
      &lt;span class="na"&gt;attestations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout repository&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Log in to the Container registry&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;registry&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ env.REGISTRY }}&lt;/span&gt;
          &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ github.actor }}&lt;/span&gt;
          &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Extract metadata (tags, labels) for Docker&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;meta&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;images&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and push Docker image&lt;/span&gt;
        &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;push&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;context&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.&lt;/span&gt;
          &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
          &lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.meta.outputs.tags }}&lt;/span&gt;
          &lt;span class="na"&gt;labels&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.meta.outputs.labels }}&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install SSH client&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install -y openssh-client&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy to VM&lt;/span&gt;
        &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;SSH_HOST&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ vars.SSH_HOST }}&lt;/span&gt;
          &lt;span class="na"&gt;SSH_USER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SSH_USER }}&lt;/span&gt;
          &lt;span class="na"&gt;SERVER_SSH_KEY&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.SERVER_SSH_KEY }}&lt;/span&gt;
          &lt;span class="na"&gt;IMAGE_TAG&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ steps.meta.outputs.tags }}&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;echo "${{ env.SERVER_SSH_KEY }}" &amp;gt; key.pem&lt;/span&gt;
          &lt;span class="s"&gt;chmod 600 key.pem&lt;/span&gt;
          &lt;span class="s"&gt;ssh -i key.pem -o StrictHostKeyChecking=no ${{ env.SSH_USER }}@${{ env.SSH_HOST }} &amp;lt;&amp;lt; 'EOF'&lt;/span&gt;
            &lt;span class="s"&gt;docker login ${{ env.REGISTRY }} -u ${{ github.actor }} -p ${{ secrets.MY_PERSONAL_PAT }}&lt;/span&gt;
            &lt;span class="s"&gt;docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}&lt;/span&gt;
            &lt;span class="s"&gt;cd ~&lt;/span&gt;
            &lt;span class="s"&gt;docker compose down frontend&lt;/span&gt;
            &lt;span class="s"&gt;docker compose up -d frontend&lt;/span&gt;
          &lt;span class="s"&gt;EOF&lt;/span&gt;
          &lt;span class="s"&gt;# Clean up the private key.pem&lt;/span&gt;
          &lt;span class="s"&gt;rm key.pem&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And don’t forget: Create the used secrets and variables in the repository settings. In this case:&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;MY_PERSONAL_PAT&lt;/li&gt;
&lt;li&gt;SERVER_SSH_KEY&lt;/li&gt;
&lt;li&gt;SSH_USER&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;Variables:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;SSH_HOST
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2024%2F06%2Fgithub-repo-settings-action-secrets.jpg" alt="GitHub Repository: Secrets and variables"&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  GitHub Container Registry: Conclusion
&lt;/h2&gt;

&lt;p&gt;That’s it! Building and publishing Docker images in the GitHub Docker Registry or GitHub Container Registry is very similar to Docker Hub. Only the login via the GitHub PAT is a little more complicated, but also offers advantages in terms of authorisation management, etc. Will you be using the GitHub Packages Registry in the future?&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to create your own PWA! #pwasAreNotDead 💀</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Sat, 01 Jun 2024 10:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/how-to-create-your-own-pwa-pwasarenotdead-c3p</link>
      <guid>https://dev.to/webdeasy/how-to-create-your-own-pwa-pwasarenotdead-c3p</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;A Progressive Web App (PWA) is a form of mobile application that features fast load times, offline functionality, and an optimized user experience. And in this guide you will learn how to simply create your own PWA!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Table of Contents 🛡️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;What are Progressive Web Apps?&lt;/li&gt;
&lt;li&gt;Downsides of Progressive Web Apps&lt;/li&gt;
&lt;li&gt;
How to build a Progressive Web App

&lt;ul&gt;
&lt;li&gt;Configure manifest.json&lt;/li&gt;
&lt;li&gt;Create Service Worker&lt;/li&gt;
&lt;li&gt;Debug PWA&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Conclusion 📝&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;In recent years, mobile Internet usage has overtaken desktop usage (&lt;a href="https://de.statista.com/statistik/daten/studie/217457/umfrage/anteil-mobiler-endgeraete-an-allen-seitenaufrufen-weltweit/" rel="noopener noreferrer"&gt;official statista figures&lt;/a&gt;). Most people nowadays access the Internet via their mobile devices. As a result, the requirements for mobile app development have changed. Progressive Web Apps (PWA) are one of the solutions that have evolved in this area.&lt;/p&gt;

&lt;h2&gt;
  
  
  WHAT ARE PROGRESSIVE WEB APPS? &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;In short, Progressive Web Apps are a type of mobile application based on a website. But what does that actually mean? Quite simply, a PWA is a mobile app that you can access from the browser on your mobile device. Unlike native apps, you don’t have to download and install a separate app.&lt;/p&gt;

&lt;h2&gt;
  
  
  DOWNSIDES OF PROGRESSIVE WEB APPS &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Progressive Web Apps (PWAs) have many advantages, but they also have some disadvantages. They have limited access to certain device features and hardware, such as the camera and contacts, making some functionality more difficult to implement than in native apps. Push notification support is limited in some browsers, potentially causing delays or failures in notification delivery. PWAs may not work on older browsers or devices because they rely on newer technologies and APIs. In addition, data storage is limited and less flexible compared to native apps, limiting features that require significant storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  HOW TO BUILD A PROGRESSIVE WEB APP &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you use WordPress, you’ll be ready in no time: install the &lt;a href="https://wordpress.org/plugins/pwa/" rel="noopener noreferrer"&gt;PWA plugin&lt;/a&gt; and in a few minutes your normal website will be transformed into a great PWA.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By the way, you can find my &lt;a href="https://webdeasy.de/en/best-wordpress-plugins/" rel="noopener noreferrer"&gt;selection of the best free WordPress plugins&lt;/a&gt; here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, it’s not always that simple. There is a bit more to creating a PWA. A PWA consists of two basic parts: the &lt;code&gt;manifest.json&lt;/code&gt; and the &lt;strong&gt;service worker&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure manifest.json
&lt;/h3&gt;

&lt;p&gt;To include the &lt;code&gt;manifest.json&lt;/code&gt; on your website you have to include the following line in the &lt;code&gt;head&lt;/code&gt;:&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="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"manifest"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"/manifest.json"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file contains all the needed information about your website, here is an example:&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="nl"&gt;"short_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"webdeasy.de"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"webdeasy.de"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"icons"&lt;/span&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;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/images/logo-512.svg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"image/svg+xml"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"512x512"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/images/logo-192.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"192x192"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/images/logo-512.png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"image/png"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"sizes"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"512x512"&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="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"start_url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"/index.html"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"background_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"#3d50a7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"display"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"standalone"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"theme_color"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"#3d50a7"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Your IT-Blog"&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;What exactly the individual parameters mean and what else there is, you can read in the &lt;a href="https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json" rel="noopener noreferrer"&gt;manifest.json documentation&lt;/a&gt;. I just want to show you how easy it is to create a basic PWA.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Service Worker
&lt;/h3&gt;

&lt;p&gt;The complete logic of your PWA is in the Service Worker, which you should put in the root directory of your website. For example, it can deliver data from the cache even when the user is offline. The service worker also allows sending push notifications and updating the app in the background without the user having to reload the page.&lt;/p&gt;

&lt;p&gt;The service worker as well as the &lt;code&gt;manifest.json&lt;/code&gt; must be included in the HTML &lt;code&gt;head&lt;/code&gt; of your website:&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="c1"&gt;// service-worker.js&lt;/span&gt;
&lt;span class="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;install&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Service worker installed&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="nb"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;addEventListener&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;activate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Service worker activated&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What you then do in the callback functions is of course dependent on your WebApp.&lt;/p&gt;

&lt;p&gt;If you test the PWA locally, you will get this error:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage.png" alt="“Registration failed: TypeError: Failed to register a ServiceWorker: The URL protocol of the current origin (‘null’) is not supported.”"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is because the HTML file is not called statically, but is delivered via a server. If you use Visual Studio you can start a live server via this &lt;a href="https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer" rel="noopener noreferrer"&gt;LiveServer extension&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If there are no errors in manifest.json this button should show up to install the PWA.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fpwa-browser-bar.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fpwa-browser-bar.png" alt="Google Chrome Browser: Install PWA"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Debug PWA
&lt;/h3&gt;

&lt;p&gt;You can debug a PWA via the “Application” tab in your Dev Tools.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage-1.png" alt="Debug PWA"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The documentation for the Service Worker can be found in the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API?retiredLocale=de" rel="noopener noreferrer"&gt;Service Worker API&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CONCLUSION
&lt;/h2&gt;

&lt;p&gt;That's it! Easy, right? If you liked this guide I would be happy if you check out my other articles on &lt;a href="https://webdeasy.de/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt;. 😻&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Some texts were created with the help of AI. All content has been thoroughly checked!&lt;/small&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JSON in JavaScript and PHP: Read, Get, Send, Convert [BASICS]</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Wed, 15 Nov 2023 16:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/json-in-javascript-and-php-read-get-send-convert-basics-1cf6</link>
      <guid>https://dev.to/webdeasy/json-in-javascript-and-php-read-get-send-convert-basics-1cf6</guid>
      <description>&lt;p&gt;&lt;em&gt;In this tutorial you will learn all the JSON basics – JSON in PHP, JSON in JavaScript and how to exchange/send JSON between JavaScript and PHP.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ❓ WHAT’S JSON?
&lt;/h2&gt;

&lt;p&gt;JSON stands for &lt;strong&gt;JavaScript Object Notation&lt;/strong&gt; and is an uncomplicated and space-saving data format that is used to store and transmit information.&lt;/p&gt;

&lt;p&gt;Data can be exchanged between the user (client) and the server. JSON is typically used as the format for &lt;a href="https://webdeasy.de/en/rest-api-testing/" rel="noopener noreferrer"&gt;Rest APIs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I will show you how to create and process JSON on the client side with JavaScript and then transfer it to the server with Ajax. There it is processed further with PHP. We look at data transfer, storage and especially the conversion of arrays to JSON and vice versa.&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="nl"&gt;"ceos"&lt;/span&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Steve Jobs"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bill Gates"&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="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Paul Allen"&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="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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is an example of JSON. Here three entries with the attributes &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;name&lt;/code&gt; are stored in the category &lt;code&gt;ceos&lt;/code&gt;. This structure is very similar to the structure of multidimensional arrays. There is a reason for this, because the conversion between these two “data types” works quite well.&lt;/p&gt;

&lt;p&gt;So that we can work properly right away, here is a link to a &lt;a href="https://jsonformatter.org/" rel="noopener noreferrer"&gt;JSON validator&lt;/a&gt; so that you can always check whether you have a valid JSON format. I would also recommend installing a JSON &lt;a href="https://webdeasy.de/en/top-vscode-extensions-en/" rel="noopener noreferrer"&gt;VSCode extension&lt;/a&gt; to display code highlighting and linting directly in the IDE.&lt;/p&gt;

&lt;p&gt;Since we mainly focus on usage – especially in PHP and JavaScript – in this article, you can have a look at the exact structure of JSON in &lt;a href="https://www.json.org/json-de.html" rel="noopener noreferrer"&gt;this article&lt;/a&gt; if you are interested.&lt;/p&gt;

&lt;h2&gt;
  
  
  👨‍💻 JSON IN PHP
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Read JSON
&lt;/h3&gt;

&lt;p&gt;In principle, JSON data can be stored very easily. A simple text file is sufficient to store the data there. This is also a common and good solution for small amounts of data. But if you have a lot of data, or data that is added dynamically (like a contact form), it is recommended to store the data in a &lt;a href="https://webdeasy.de/en/php-database-class/" rel="noopener noreferrer"&gt;database&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;However, we assume small amounts of data and have a file on the server side, e.g. with the name storage.json with the following content (same content as the above example, only in minified)&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="nl"&gt;"heroes"&lt;/span&gt;&lt;span class="p"&gt;:[{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Steve Jobs"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Bill Gates"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Paul Allen"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Sundar Pichai"&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;With the following lines we can have the file read and output in PHP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"storage.json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;print_r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The unformatted output gives us the simple text content of the file:&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="nl"&gt;"heroes"&lt;/span&gt;&lt;span class="p"&gt;:[{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Steve Jobs"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Bill Gates"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Paul Allen"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Sundar Pichai"&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;We cannot do much with this data in this form. We could write our own parser to convert it into an object or array. But it is much easier.&lt;/p&gt;

&lt;p&gt;PHP offers us the function &lt;a href="https://www.php.net/manual/de/function.json-decode.php" rel="noopener noreferrer"&gt;&lt;code&gt;json_decode()&lt;/code&gt;&lt;/a&gt; to convert the JSON string into an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"storage.json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$json_decoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;print_r&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JSON string has been converted to an object and we can treat it like any other object in PHP. This output looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stdClass Object
(
    [heroes] =&amp;gt; Array
        (
            [0] =&amp;gt; stdClass Object
                (
                    [id] =&amp;gt; 1
                    [name] =&amp;gt; Steve Jobs
                )
            [1] =&amp;gt; stdClass Object
                (
                    [id] =&amp;gt; 2
                    [name] =&amp;gt; Bill Gates
                )
            [2] =&amp;gt; stdClass Object
                (
                    [id] =&amp;gt; 3
                    [name] =&amp;gt; Paul Allen
                )
            [3] =&amp;gt; stdClass Object
                (
                    [id] =&amp;gt; 4
                    [name] =&amp;gt; Sundar Pichai
                )
        )
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As already mentioned we can now use normal object operators to output or change values of the object. So in this case it makes no difference to us whether we get an array or an object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"storage.json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$json_decoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;heroes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Output: Steve Jobs&lt;/span&gt;

&lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;heroes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CEO Steve Jobs"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;heroes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// Output: CEO Steve Jobs&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Save JSON
&lt;/h3&gt;

&lt;p&gt;Once we have adjusted our data as desired, we can save our JSON data in PHP.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt; 
&lt;span class="nv"&gt;$filename&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"storage.json"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$json_decoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_decode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;heroes&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"CEO Steve Jobs"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nv"&gt;$json_encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;json_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$json_decoded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;file_put_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$filename&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$json_encoded&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Since we decoded the JSON string during readout, we have to encode it again before saving. This is done in PHP via &lt;a href="https://www.php.net/manual/de/function.json-encode.php" rel="noopener noreferrer"&gt;&lt;code&gt;json_encode()&lt;/code&gt;&lt;/a&gt;. That’s about it. Simple, right?&lt;/p&gt;

&lt;h2&gt;
  
  
  📨 SEND JSON FROM JAVASCRIPT TO PHP (AJAX)
&lt;/h2&gt;

&lt;p&gt;To request data on the client side I like to use &lt;a href="https://webdeasy.de/en/jquery-to-javascript/" rel="noopener noreferrer"&gt;jQuery&lt;/a&gt;, because I save some lines of JavaScript. We can do the same with other frameworks or libraries like &lt;a href="https://webdeasy.de/en/3-practical-examples-vue-js/" rel="noopener noreferrer"&gt;Vue.js&lt;/a&gt;, you can find the corresponding functions in their documentation. Here is an example, which makes an &lt;a href="https://api.jquery.com/jquery.ajax/" rel="noopener noreferrer"&gt;ajax&lt;/a&gt; request to our server.php and gets the data returned.&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;!-- index.html --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;JSON in PHP and JavaScript&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
        &lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getJSON&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;server.php&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="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&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;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="c1"&gt;// server.php&lt;/span&gt;
&lt;span class="nv"&gt;$file&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file_get_contents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"storage.json"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;exit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$file&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The JavaScript Console output looks like this:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2019%2F05%2Fjson-console-log.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2019%2F05%2Fjson-console-log.png" alt="JSON Console Log"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So we have already in JavaScript normal access to the data, which originally comes from our &lt;em&gt;storage.json&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;By the way:&lt;/strong&gt; WordPress has its own functions to manage Ajax data – &lt;a href="https://webdeasy.de/en/ajax-in-wordpress-en/" rel="noopener noreferrer"&gt;learn how here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  👨‍💻 JSON IN JAVASCRIPT
&lt;/h2&gt;

&lt;p&gt;But if we have a JSON string in JavaScript, we can convert it to a JavaScript object using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse?retiredLocale=de" rel="noopener noreferrer"&gt;&lt;code&gt;JSON.parse()&lt;/code&gt;&lt;/a&gt; function. That looks like this:&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="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;{"heroes":[{"id":"1","name":"CEO Steve Jobs"},{"id":"2","name":"Bill Gates"},{"id":"3","name":"Paul Allen"},{"id":"4","name":"Sundar Pichai"}]}&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output is identical to the output from our &lt;em&gt;storage.json&lt;/em&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2019%2F05%2Fjson-console-log-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2019%2F05%2Fjson-console-log-1.png" alt="JSON Console Log&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Conversely, we can convert a JavaScript object to JSON with &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify?retiredLocale=de" rel="noopener noreferrer"&gt;&lt;code&gt;JSON.stringify()&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The output is then again our JSON string, which we also have in the variable &lt;code&gt;json&lt;/code&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="nl"&gt;"heroes"&lt;/span&gt;&lt;span class="p"&gt;:[{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"CEO Steve Jobs"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Bill Gates"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Paul Allen"&lt;/span&gt;&lt;span class="p"&gt;},{&lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Sundar Pichai"&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;h2&gt;
  
  
  📚 CONCLUSION
&lt;/h2&gt;

&lt;p&gt;Both PHP and JavaScript provide functions that simplify working with JSON, a straightforward and efficient data format for exchanging data between the two languages. This is typically the optimal choice for most web development and design use cases.&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>What is CI/CD? 🤖 Definitions, Concepts and CI/CD Tools at a glance</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Mon, 16 Oct 2023 07:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/what-is-cicd-definitions-concepts-and-cicd-tools-at-a-glance-52j1</link>
      <guid>https://dev.to/webdeasy/what-is-cicd-definitions-concepts-and-cicd-tools-at-a-glance-52j1</guid>
      <description>&lt;p&gt;&lt;em&gt;What do the terms CI/CD, CI/CD pipeline, CI/CD tools and DevOps mean? In this article you will get a comprehensive explanation of all the terms, concepts and technologies you need to understand in the context of CI/CD.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR 🙄
&lt;/h2&gt;

&lt;p&gt;You will get an overview, detailed but not too detailed about everything you need to know about &lt;strong&gt;CI/CD&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  What you will learn 📖
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Continuous Integration (CI)&lt;/li&gt;
&lt;li&gt;Continuous Delivery (CD)&lt;/li&gt;
&lt;li&gt;What is DevOps?&lt;/li&gt;
&lt;li&gt;What is a CI/CD pipeline?&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#what-is-the-difference-between-continuous-delivery-and-continuous-deployment"&gt;What is the difference between Continuous Delivery and Continuous Deployment?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#advantages-of-ci-cd"&gt;Advantages of CI/CD&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#what-are-ci-cd-tools-and-which-one-should-i-use"&gt;What are CI/CD tools and which one should I use?&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#overview-of-known-ci-cd-tools"&gt;Overview of known CI/CD tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#selection-criteria-for-the-right-tool"&gt;Selection criteria for the right tool&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/what-is-ci-cd/#conclusion-ci-cd-the-way-to-more-efficient-software-development-and-higher-quality"&gt;Conclusion: CI/CD - The way to more efficient software development and higher quality&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Google trend data shows that the search term "CI/CD" is experiencing a surge in popularity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ki7o9pmv9c392aba6oi.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ki7o9pmv9c392aba6oi.JPG" alt="Google Trends CI/CD" width="800" height="309"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In modern software development, the terms “CI/CD” and “DevOps” are widely used. However, what do these terminologies signify, and why are they crucial? What is the foundation of this movement, and how can it transform software development?&lt;/p&gt;

&lt;p&gt;Continuous Integration (CI) and Continuous Delivery (CD) are crucial concepts in contemporary software development. They establish the foundation for effective and superior software distribution. First, let’s examine the explanations of these terms. If you are unfamiliar with CI/CD, these definitions may appear quite abstract. Nevertheless, by the end of this article, all your queries should be resolved.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Integration (CI) ⚙️&lt;a href="continuous-integration-ci"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Continuous Integration (CI) is a development method where developers regularly merge their code into a shared repository. The main concept behind CI is the constant integration of any code changes made into the main code base. Whenever developers make code alterations, automated build and test procedures are initiated to guarantee that the code operates correctly and does not interfere with any of the present functions. The aim of CI is to detect conflicts and errors early on while consistently monitoring the code’s quality.&lt;/p&gt;

&lt;h2&gt;
  
  
  Continuous Delivery (CD) 🏭&lt;a href="continuous-delivery-cd"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Continuous Delivery is a logical extension of CI and denotes the automated deployment of software in a production environment. CI enables software to be readily deployable in the production environment but does not, however, automatically release it into production space. Instead, deployment is automated up to the production environment, and the release into production space still necessitates manual approval. No changes needed as the text already adheres to the principles and lacks context.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DevOps? 👨‍💻&lt;a href="what-is-devops"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;CI/CD and DevOps are closely linked. DevOps is a culture and practice that aims to enhance collaboration and communication between an organisation’s development and operations teams. Its primary objective is to streamline the software development and delivery process, allowing for quicker and more dependable software delivery.&lt;/p&gt;

&lt;p&gt;The conventional method of software development and IT operations can foster silos, where developers and operations function independently and have divergent objectives. This can cause delivery delays, quality problems, and disputes. DevOps seeks to bridge these gaps by fostering close collaboration between teams. To this end, various tools, including CI/CD pipelines, are employed.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a CI/CD Pipeline? 🔧&lt;a href="what-is-a-ci-cd-pipeline"&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;A crucial component of modern software development and DevOps practices is a CI/CD pipeline, also known as a DevOps pipeline. It’s an automated sequence of steps that enables software CI/CD processes, and the central part of an efficient software development and delivery workflow. The structure of a CI/CD pipeline is demonstrated in the given diagram.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v51UdeFO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/09/pipeline.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v51UdeFO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/09/pipeline.png" alt="CI/CD pipeline&amp;lt;br&amp;gt;
" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The CI/CD pipeline is an automated workflow that covers the entire software development lifecycle from code change to production deployment....&lt;/p&gt;




&lt;blockquote&gt;
&lt;h3&gt;
  
  
  It's cool that you're so passionate about CI/CD! 🔥
&lt;/h3&gt;
&lt;h3&gt;
  
  
  ➡️ &lt;a href="https://webdeasy.de/en/what-is-ci-cd/?action=read-full-post"&gt;Read the rest of the post on my blog&lt;/a&gt; ❤️
&lt;/h3&gt;
&lt;/blockquote&gt;

</description>
      <category>devops</category>
      <category>cicd</category>
      <category>beginners</category>
      <category>testing</category>
    </item>
    <item>
      <title>🐋 Docker Init command: Create Docker projects automatically 🚀</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Wed, 04 Oct 2023 12:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/docker-init-command-create-docker-projects-automatically-g3g</link>
      <guid>https://dev.to/webdeasy/docker-init-command-create-docker-projects-automatically-g3g</guid>
      <description>&lt;p&gt;&lt;strong&gt;Docker Init lets you set up a Docker project in a snap. With just one CLI command, &lt;code&gt;docker init&lt;/code&gt;, you can generate everything you need.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Docker has revolutionised the software development process, simplifying software deployment and making it more accessible to other developers. The recently-introduced Docker Init command streamlines project creation by generating configuration files with a single command.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;docker init&lt;/code&gt; dockerises your application! :)&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Init 🐋
&lt;/h2&gt;

&lt;p&gt;The command creates three files in your project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;a &lt;em&gt;Dockerfile&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;a &lt;em&gt;.dockerignore&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;and a &lt;em&gt;compose.yaml&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In other words, all the files that are necessary for a complete Docker App.&lt;/p&gt;

&lt;p&gt;To use the Docker Init command, you only need Docker Desktop &lt;strong&gt;&amp;gt; version 4.18&lt;/strong&gt;. And of course a non-dockerised project, i.e. a project for which no Docker files exist yet.&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://www.docker.com/products/docker-desktop/" rel="noopener noreferrer"&gt;Download Docker Desktop&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported languages 👨‍💻
&lt;/h2&gt;

&lt;p&gt;Currently, the command supports 5 programming languages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ASP.NET&lt;/li&gt;
&lt;li&gt;Go&lt;/li&gt;
&lt;li&gt;Node&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Rust&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a project does not involve any of the languages, the &lt;em&gt;Dockerfile&lt;/em&gt; is configured to establish an entry point that is universally applicable.&lt;/p&gt;

&lt;p&gt;However, it is highly likely that the capabilities of this command will be extended in future updates, leaving us intrigued.&lt;/p&gt;

&lt;h2&gt;
  
  
  Docker Init in Action 🎬
&lt;/h2&gt;

&lt;p&gt;Let's get down to business and look at the command in action in a &lt;a href="https://webdeasy.de/en/node-js-tutorial-en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt; application.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-before-execution.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-before-execution.jpg" alt="Docker Init command in a Node project in Visual Studio Code"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-start.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-start.jpg" alt="Executed Docker Init command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will then be guided through a range of questions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? What application platform does your project use? Node
? What version of Node do you want to use? (20.5.1) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? What application platform does your project use? Node
? What version of Node do you want to use? 20.5.1
? Which package manager do you want to use?  [Use arrows to move, type to filter]
&amp;gt; npm - (detected)
  yarn
  pnpm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? What application platform does your project use? Node
? What version of Node do you want to use? 20.5.1
? Which package manager do you want to use? npm
? What command do you want to use to start the app? [tab for suggestions] (node index.js)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;? What application platform does your project use? Node
? What version of Node do you want to use? 20.5.1
? Which package manager do you want to use? npm
? What command do you want to use to start the app? node index.js
? What port does your server listen on? 3000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And that is all. We get the three said files that we need for a complete Docker project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-after-execution.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-after-execution.jpg" alt="Result of the Docker Init command"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-files.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-init-files.jpg" alt="Dockerfile, .dockerignore and compose.yaml"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To check the configuration, we run the &lt;code&gt;docker compose&lt;/code&gt; command: Running!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-compose-running.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F09%2Fdocker-compose-running.jpg" alt="docker compose up&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And the &lt;em&gt;Dockerfile&lt;/em&gt; also works for a single Docker container. We get a running container for our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build -t docker-init-app .
docker run -p 3000:3000 docker-init-app
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Advantages of Docker Init ⭐
&lt;/h2&gt;

&lt;p&gt;In my eyes, the command offers numerous advantages for developers and teams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Accelerated project initialisation:&lt;/strong&gt; Docker Init automates the creation of all configuration files. This eliminates the time-consuming manual creation of these files and speeds up development processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency and standardisation:&lt;/strong&gt; Like &lt;a href="https://webdeasy.de/en/what-is-ci-cd/" rel="noopener noreferrer"&gt;CI/CD&lt;/a&gt; tools, using the Docker Init command ensures that all projects have a consistent and standardised Docker configuration. This leads to fewer configuration errors and improved team collaboration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced error-proneness:&lt;/strong&gt; Docker Init helps minimise errors in Docker configuration by implementing best practices and recommended structures for Docker projects. This leads to more robust and reliable applications.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Overall, Docker Init makes it easier for developers to enter the world of Docker projects and helps to increase the efficiency, reliability and consistency of applications. This leads to accelerated development and an overall improved development quality.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Psssst! Do you know the &lt;a href="https://webdeasy.de/en/docker-vs-virtual-machines/" rel="noopener noreferrer"&gt;difference between (Docker) containers and virtual machines (VMs)&lt;/a&gt;?&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;The Docker Init command highlights Docker’s prominence in software development. By using this command, developers can rapidly create Docker projects while minimising configuration file setup.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>devops</category>
      <category>productivity</category>
    </item>
    <item>
      <title>30 awesome CSS Background Patterns ✨</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Sat, 02 Sep 2023 14:05:23 +0000</pubDate>
      <link>https://dev.to/webdeasy/30-awesome-css-background-patterns-dpl</link>
      <guid>https://dev.to/webdeasy/30-awesome-css-background-patterns-dpl</guid>
      <description>&lt;p&gt;With these 30 CSS Background Patterns you are sure to find the perfect background for your app or website.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The pens shown are licensed with MIT. You can find more info about your own use on the &lt;a href="https://blog.codepen.io/documentation/licensing/"&gt;Codepen Blog&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  #1 Japanese cube
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/tankred/embed/vELNNY?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/tankred"&gt;Tankred&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #2 Steps
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/joshnh/embed/DWNgJX?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/joshnh"&gt;Joshua Hibbert&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #3 Rotan weave
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/jroenf/embed/DgbMqV?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/jroenf"&gt;Joroen Franse&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #4 Tables
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/thebabydino/embed/yLEvaeE?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/thebabydino"&gt;Ana Tudor&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #5 Slack CSS background pattern
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/MHLut/embed/JKEjJK?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/MHLut"&gt;Marijke Luttekes&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #6 Children in Need CSS Background Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/chris22smith/embed/dOOrOP?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/chris22smith/pen/dOOrOP"&gt;Chris Smith&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #7 Street in the city
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/lovefield/embed/NdGVMG?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/lovefield"&gt;Ha Hyun Yong&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #8 Rainbow
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/raad/embed/kNRgZw?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/raad"&gt;Raad Al-Raw&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #9 Circles
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/sjhudek/embed/QNeBBL?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/sjhudek"&gt;Steve Hudek&lt;/a&gt;;&lt;/p&gt;

&lt;h2&gt;
  
  
  #10 Blue Triangles
&lt;/h2&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/vlad-saling/embed/ndwyJy?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Author: &lt;a href="https://codepen.io/vlad-saling"&gt;vlad-saling&lt;/a&gt;;&lt;/p&gt;





&lt;center&gt;
&lt;br&gt;
&lt;strong&gt;⭐🔗 &lt;a href="https://webdeasy.de/en/css-background-patterns-en/"&gt;Find the other 20 CSS backgrounds on my blog&lt;/a&gt; 🔗⭐&lt;br&gt;
&lt;/strong&gt;
&lt;/center&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: All forms are all published on &lt;a href="https://codepen.io/"&gt;codepen.io&lt;/a&gt; and &lt;u&gt;not&lt;/u&gt; by me.&lt;/p&gt;


&lt;/blockquote&gt;

&lt;p&gt;...or out my other CSS Collections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/top-css-buttons-en/"&gt;CSS Buttons&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/css-hamburger-menus-en/"&gt;CSS Hamburger Menus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/top-404-pages/"&gt;CSS 404-Error Pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/top-css-navigation-menus-en/"&gt;CSS Menu Inspirations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/satisfying-css-animations/"&gt;CSS Animations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/css-loading-animations/"&gt;CSS Loading Animations&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webdeasy.de/en/css-forms/"&gt;CSS Forms&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>css</category>
      <category>webdev</category>
      <category>html</category>
    </item>
    <item>
      <title>TOP 20 VSCode Extensions to increase your productivity! 🚀</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Mon, 07 Aug 2023 12:00:00 +0000</pubDate>
      <link>https://dev.to/webdeasy/top-20-vscode-extensions-to-increase-your-productivity-352d</link>
      <guid>https://dev.to/webdeasy/top-20-vscode-extensions-to-increase-your-productivity-352d</guid>
      <description>&lt;p&gt;VSCode (Visual Studio Code) is a very widely used and free code editor. With countless VSCode extensions you can program in any language and much more! I’ll show you the best VSCode extensions so you can be even more productive.&lt;/p&gt;

&lt;p&gt;The right VSCode extensions, i.e. plugins for Visual Studio Code, turn the source code editor into a real secret weapon. Over the years, some extensions have proven to be more useful and others less so.&lt;/p&gt;

&lt;p&gt;Since the plugins can be installed and uninstalled with two clicks, you can easily try them out and see if they help you. All shown VSCode extensions I use myself, so I can present them here with a good conscience. 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  1. ChatGPT – Genie AI
&lt;/h2&gt;

&lt;p&gt;How could it be otherwise, we start with an extension that uses &lt;a href="https://webdeasy.de/en/using-chatgpt-as-developer/"&gt;ChatGPT&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Shortly after ChatGPT was released, there were of course countless extensions for VSCode. I tried a lot of them, but Genie AI worked best for me. You have directly in the context menu the possibility to “commission” predefined actions, like explaining marked code, adding comments or optimizing the code.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--rrzQx5gK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/genie-ai.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rrzQx5gK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/genie-ai.gif" alt="ChatGPT – Genie AI Demonstration" width="800" height="660"&gt;&lt;/a&gt;&lt;br&gt;
The background prompts can all be customized individually in the settings, making it the best AI plugin for Visual Studio Code for me.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=genieai.chatgpt-vscode"&gt;ChatGPT Genie AI&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Favorites
&lt;/h2&gt;

&lt;p&gt;A very small but very useful VSCode extension: Favorites. As the name says it gives you the possibility to mark single files as favorites, so you can access them quickly. I use this function mostly for config files that I have to access all the time.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CbwYaZQx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/favorites-650x328.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CbwYaZQx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/favorites-650x328.png" alt="Favorites Demonstration" width="650" height="328"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=howardzuo.vscode-favorites"&gt;Favorites&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. MinifyAll
&lt;/h2&gt;

&lt;p&gt;Storage space has become relatively cheap today. However, it makes sense to transfer as little data as possible to end users. This is where MinifyAll comes in and minifies your files. Currently the plugin can handle 14 different languages.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jQP8JL9f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/minify-all.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jQP8JL9f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/minify-all.gif" alt="MinifyAll Demonstration" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=josee9988.minifyall"&gt;MinifyAll&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Docker
&lt;/h2&gt;

&lt;p&gt;For a long time I “ignored” &lt;a href="https://www.youtube.com/watch?v=pg19Z8LL06w"&gt;Docker&lt;/a&gt;. Now it has become a real secret weapon for me and extremely versatile. So if you haven’t worked with Docker yet, I highly recommend it! It’s perfect for quickly testing another environment or deploying your application.&lt;/p&gt;

&lt;p&gt;The VSCode extension of the same name helps you speed up image building, highlight code, and keep track of running containers and images.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B7b2_gF6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/docker.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B7b2_gF6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/docker.gif" alt="Docker Demonstration" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker"&gt;Docker&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Better Comments
&lt;/h2&gt;

&lt;p&gt;A small but good extension. It highlights comments with different keywords, like “TODO” or starting with an exclamation mark, so you can’t miss the comment at all.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6K1MMCFP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/better-comments.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6K1MMCFP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/better-comments.png" alt="Better Comments Demonstration" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments"&gt;Better Comments&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Code Spell Checker
&lt;/h2&gt;

&lt;p&gt;Also a small but nice extension, which I see as an extension for “Better Comments”. It underlines spelling mistakes for you. This can increase the quality of your comments.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f3Tu101e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/code-spell-checker.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f3Tu101e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/code-spell-checker.png" alt="Code Spell Checker Demonstration" width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker"&gt;Code Spell Checker&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  7. GitLens – Git supercharged
&lt;/h2&gt;

&lt;p&gt;Visual Studio already has a built-in Git client – so far so good. But GitLens extends the functionality even further, so that you can see the last commit message directly after each line of code, compare it directly with the changes and much more. Be sure to try it out!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iqTmYz2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/gitlens.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iqTmYz2i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/gitlens.gif" alt="GitLens Demonstration&amp;lt;br&amp;gt;
" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens"&gt;GitLens - Git supercharged&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  8. Regex Previewer
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://webdeasy.de/en/regex-validation-cheatsheet-en/"&gt;Regular expressions&lt;/a&gt; can be found in pretty much every app. However, creating them can sometimes be a bit tricky. This is where Regex Previewer comes in and shows you directly the matches of your expression in a second window. This way you can debug directly live.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5Z8VK5dT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/regex-previewer.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5Z8VK5dT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/regex-previewer.gif" alt="Regex Previewer Demonstration&amp;lt;br&amp;gt;
" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=chrmarti.regex"&gt;Regex Previewer&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  9. Test Explorer UI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://webdeasy.de/en/rest-api-testing/"&gt;Testing&lt;/a&gt; is very important, but sometimes it can be very annoying and time consuming. Test Explorer UI can take some of the work out of this by showing you all the tests graphically and also running and evaluating them directly when you save them.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3ajbCitX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/test-explorer-ui.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3ajbCitX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/test-explorer-ui.gif" alt="Test Explorer UI Demonstration&amp;lt;br&amp;gt;
" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer"&gt;Test Explorer UI&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  10. Remote – SSH
&lt;/h2&gt;

&lt;p&gt;If you often work on external systems, you should have a look at “Remote – SSH”. This VSCode extension establishes a connection via SSH, so that you can execute SSH commands directly in the terminal and – what I find even cooler – you can open the files in the explorer directly via SFTP, instead of having to edit them manually via an FTP client.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z1kOVZ4b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/remote-ssh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z1kOVZ4b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/remote-ssh.png" alt="Remote – SSH Demonstration" width="800" height="601"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh"&gt;Remote - SSH&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;All other VSCode extensions are more specialized for developers working in the field of web development.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Node.js Extensions Pack
&lt;/h2&gt;

&lt;p&gt;As a &lt;a href="https://webdeasy.de/en/node-js-tutorial-en/"&gt;Node.js&lt;/a&gt; developer, you really need this plugin. It helps you complete imports, simplifies npm commands and much, much more.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1TtObn08--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/node-extensions-pack.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1TtObn08--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/node-extensions-pack.png" alt="Node.js Extensions Pack" width="772" height="876"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=waderyan.nodejs-extension-pack"&gt;Node.js Extensions Pack&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  12. DotENV
&lt;/h2&gt;

&lt;p&gt;DotENV highlighted your .env files, simple but useful.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DR8OvHlw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/dotenv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DR8OvHlw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/dotenv.png" alt="DotEnv Demonstration" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=mikestead.dotenv"&gt;DotENV&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  13. ESLint
&lt;/h2&gt;

&lt;p&gt;All JavaScript &amp;amp; Typescript developers will know and love ESLint. The VSCode extension of the same name implements ESLint in VSCode. For this, ESLint must be installed globally via npm (&lt;code&gt;npm i -g eslint&lt;/code&gt;).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j7ka2MYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/eslint.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j7ka2MYV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/eslint.png" alt="ESLint Extension" width="785" height="666"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint"&gt;ESLint&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  14. Jest
&lt;/h2&gt;

&lt;p&gt;The testing framework Jest has many functions, which the VSCode extension Jest implements via autocompletion in Visual Studio. This should save you some time writing tests.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W1VQheVN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/jest.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W1VQheVN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/jest.png" alt="Jest Extension" width="788" height="784"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest"&gt;Jest&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  15. Python
&lt;/h2&gt;

&lt;p&gt;As a Python developer you need this extension. It implements Python directly in Visual Studio. Via an arrow you can execute your Python app directly, debug it and of course highlighting and autocompletion are also included in this plugin.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5nX2pb_m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/python.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5nX2pb_m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/python.gif" alt="Python Demonstration" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=ms-python.python"&gt;Python&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  16. REST Client
&lt;/h2&gt;

&lt;p&gt;With REST Client you can now test your Rest API even faster and easier in the code editor. You can execute requests using a very simple syntax. Of course you can customize all header data as you like. So you have your tests directly near your code.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4OazAnFM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/rest-client.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4OazAnFM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/rest-client.gif" alt="REST Client Demonstration" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=humao.rest-client"&gt;REST Client&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  17. Prettier – Code formatter
&lt;/h2&gt;

&lt;p&gt;Prettier supports numerous languages and formats the code so that it is easy to read and it provides a uniform standard for all developers of your project.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4c3aGwBs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/prettier.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4c3aGwBs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/prettier.png" alt="Prettier – Code formatter&amp;lt;br&amp;gt;
" width="791" height="709"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode"&gt;Prettier - Code formatter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  18. css-auto-prefix
&lt;/h2&gt;

&lt;p&gt;CSS requires prefixes for some attributes for certain browsers. These are often forgotten when programming. This extension puts an end to that. As soon as you write a CSS property or even just click on it, the corresponding lines with the browser prefixes are automatically added.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IvKNc0wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/css-auto-prefix.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IvKNc0wo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/css-auto-prefix.gif" alt="css-auto-prefix Demonstration&amp;lt;br&amp;gt;
" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=sporiley.css-auto-prefix"&gt;css-auto-prefix&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  19. CSS Peek
&lt;/h2&gt;

&lt;p&gt;This VSCode extension connects your CSS rules with the corresponding HTML tag and vice versa. So you don’t have to search for the rules anymore, but can jump directly to the right place.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--B8Kq02s1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/css-peek.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B8Kq02s1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/css-peek.gif" alt="CSS Peek Demonstration&amp;lt;br&amp;gt;
" width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=pranaygp.vscode-css-peek"&gt;CSS Peek&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  20. WordPress Hooks IntelliSense
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://webdeasy.de/en/best-wordpress-plugins/"&gt;WordPress&lt;/a&gt; has a lot of its own functions, which you can’t know by heart – let alone the syntax. The plugin WordPress Hooks IntelliSense offers you an autocompletion for all these functions.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vbrI8whh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/wordpress-hooks-intellisense.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vbrI8whh--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2023/05/wordpress-hooks-intellisense.png" alt="WordPress Hooks IntelliSense&amp;lt;br&amp;gt;
" width="800" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://marketplace.visualstudio.com/items?itemName=johnbillion.vscode-wordpress-hooks"&gt;WordPress Hooks IntelliSense&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;What other VSCode extensions do you know that are your daily companion? Feel free to let me know in the comments!&lt;/em&gt; 🙂&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>productivity</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Indispensable: The 9 best WordPress plugins 🌱</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Sat, 29 Apr 2023 09:40:50 +0000</pubDate>
      <link>https://dev.to/webdeasy/indispensable-the-9-best-wordpress-plugins-1c81</link>
      <guid>https://dev.to/webdeasy/indispensable-the-9-best-wordpress-plugins-1c81</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;The free CMS WordPress officially has almost 60,000 plugins. But which WordPress plugins do you really need? I present you 9 free WordPress plugins that will make your website better!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Hardly any WordPress site can do completely without plugins – that’s not even necessary. There are numerous useful and good WordPress plugins out there that can equip your site in terms of &lt;strong&gt;&lt;a href="https://webdeasy.de/en/free-seo-tools/"&gt;SEO&lt;/a&gt;, privacy, user-friendliness&lt;/strong&gt; but also with &lt;strong&gt;great features&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;With almost a decade of experience with WordPress, I think I can put together a pretty good selection for you here. 🙂&lt;/p&gt;

&lt;p&gt;All the presented plugins are free to use. Some also offer a premium version to unlock more features.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Disclaimer: All the presented plugins are free to use. Some also offer a premium version to unlock more features.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;On the internet you can find many lists, which sometimes present 30, 50 or even more WordPress plugins at once. This list is deliberately kept quite small and that has a specific reason:&lt;/p&gt;

&lt;h2&gt;
  
  
  Less is more!
&lt;/h2&gt;

&lt;p&gt;This is true for many things in life, including the number of WordPress plugins.&lt;/p&gt;

&lt;p&gt;There is no guideline how many plugins a WordPress site may have at least or maximum. But from my own experience I know that most sites use between 5-25 plugins.&lt;/p&gt;

&lt;p&gt;But why is that so important anyway?&lt;/p&gt;

&lt;p&gt;Almost every plugin that is installed and activated requires processing power when the page is called up, since it naturally has to perform its tasks in the background – be it the generation of images, insertion of content or SEO adjustments. All of this is a drain on your website’s resources.&lt;/p&gt;

&lt;p&gt;And another thing: Not for all functions you need a plugin. How you can create a &lt;a href="https://webdeasy.de/en/wordpress-table-of-contents-without-plugin/"&gt;table of contents in WordPress&lt;/a&gt; without a plugin and many more great things you will learn at the end of the post.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Hummingbird
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category:&lt;/strong&gt; SEO/Caching // 100,000+ active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--48UWdu4y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/hummingbird.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--48UWdu4y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/hummingbird.jpg" alt="Hummingbird Dashboard&amp;lt;br&amp;gt;
" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hummingbird is a comprehensive plugin which, besides its main task of caching resources (JS &amp;amp; CSS files), can significantly improve the general page speed through numerous techniques, such as lazy loading, load integration or world-class caching.&lt;/p&gt;

&lt;p&gt;There are other caching plugins, like &lt;a href="https://de.wordpress.org/plugins/wp-super-cache/"&gt;WP Super Cache&lt;/a&gt; or &lt;a href="https://de.wordpress.org/plugins/w3-total-cache/"&gt;W3 Total Cache&lt;/a&gt;, both of which also have more than 1 million active installs. I have also tested these plugins in the past and was able to achieve the best results with Hummingbird.&lt;/p&gt;

&lt;p&gt;The plugin also gives you useful tips for server configuration, e.g. to enable Gzip compression under Apache2 and nginx. Speed tests are evaluated directly via the plugin and suitable settings are suggested.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mgn9RCbK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/performance-report-750x317.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mgn9RCbK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/performance-report-750x317.jpg" alt="Hummingbird Performance Report&amp;lt;br&amp;gt;
" width="750" height="317"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;Actually for everyone. Every user is happy when a page loads fast and it can also reduce the server load. So if you don’t use a caching plugin yet, this plugin is a good choice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/hummingbird-performance/"&gt;Install Hummingbird&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Advanced Custom Fields
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category:&lt;/strong&gt; Features for content editor // 2+ Millions active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6TOT4BcD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/acf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6TOT4BcD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/acf.jpg" alt="Advanced Custom Fields – Edit Group&amp;lt;br&amp;gt;
" width="800" height="534"&gt;&lt;/a&gt;&lt;br&gt;
Advanced Custom Fields is one of my favorite plugins. With this plugin you can – as the name suggests – create your own fields/attributes. Specifically, this means that you can set individual options for specific pages, templates, post types or taxonomies.&lt;/p&gt;

&lt;p&gt;If you would like to assign a specific color to each category, you can do so here. Do you want to be able to set a price for each page with the “Product” template? No problem with Advanced Custom Fields.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2xzdk--3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/acf-in-action-650x267.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2xzdk--3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/acf-in-action-650x267.jpg" alt="Advanced Custom Fields – Insert Data&amp;lt;br&amp;gt;
" width="650" height="267"&gt;&lt;/a&gt;&lt;br&gt;
With the &lt;a href="https://www.advancedcustomfields.com/pro/"&gt;Pro version&lt;/a&gt; you have some additional features, like creating your own Gutenberg Blocks or the function of “Repeating Fields”. The latter is very useful and saves a lot of work, because you don’t have to create Slide1, Slide2, Slide3,… for a slider. You can simply create a repeating field “Slide” and then create as many slides as you want dynamically.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;For those who want to create/program their own content blocks and add more attributes and properties to individual page types.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/advanced-custom-fields/"&gt;Install Advanced Custom Fields&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Rank Math
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category:&lt;/strong&gt; SEO // 1+ Million of active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TL8kTN4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/rankmath.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TL8kTN4K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/rankmath.jpg" alt="Rank Math Dashboard&amp;lt;br&amp;gt;
" width="800" height="401"&gt;&lt;/a&gt;&lt;br&gt;
Rank Math is one of the most popular SEO plugins for WordPress, along with &lt;a href="https://de.wordpress.org/plugins/wordpress-seo/"&gt;Yoast SEO&lt;/a&gt;. Besides the usual functions like setting title, description and keywords, Rank Math can also output &lt;a href="https://developers.google.com/search/docs/advanced/structured-data/intro-structured-data?hl=en"&gt;structured data&lt;/a&gt;. This helps Google to present your site more interesting to the user. For example, reviews, recipes or job descriptions can be placed in appropriate tabs on Google – this creates better visibility.&lt;/p&gt;

&lt;p&gt;In addition, the plugin offers many more features to help you with the SEO process.&lt;/p&gt;

&lt;p&gt;Recently, Rank Math also offers a content AI feature, which is supposed to suggest matching keywords and content to you in order to better tailor the content to your visitors.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;For anyone who runs a website to be found by search engines – so almost everyone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/seo-by-rank-math/"&gt;Install Rank Math&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Contact Form 7
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category&lt;/strong&gt;: Features // 5+ Millions active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5wuqAH4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/cf7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5wuqAH4s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/cf7.jpg" alt="Contact Form 7&amp;lt;br&amp;gt;
" width="800" height="344"&gt;&lt;/a&gt;&lt;br&gt;
This plugin is in my eyes the best WordPress plugin to embed custom forms.&lt;/p&gt;

&lt;p&gt;You can create as many forms as you want and equip them with all kinds of text fields, checkboxes, dropdowns, file uploads and privacy checkboxes. You can set all imaginable options like placeholders, labels or input types (tel, email, number, …). Integration with &lt;a href="https://webdeasy.de/en/hide-google-recaptcha-badge/"&gt;Google reCaptcha&lt;/a&gt; is also available.&lt;/p&gt;

&lt;p&gt;When the form is submitted you can set the mail template where automatically the data can be inserted. Also shipping and error notifications can be set. In the area of the form there is actually nothing that this plugin can not do.&lt;/p&gt;

&lt;p&gt;The plugin &lt;a href="https://de.wordpress.org/plugins/contact-form-cfdb7/"&gt;Contact Form 7 Database Addon – CFDB7&lt;/a&gt; additionally offers the possibility to write the form data into the database and retrieve it via the backend.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;For anyone who wants to have their own (self-maintainable) form on their website (HTML knowledge is helpful).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/contact-form-7/"&gt;Install Contact Form 7&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Newsletter
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category&lt;/strong&gt;: Feature/User engagement // 400,000+ active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aWIMDPQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/newsletter.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aWIMDPQr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/newsletter.jpg" alt="Newsletter Overview&amp;lt;br&amp;gt;
" width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This plugin is responsible for managing subscribers and sending newsletters. Using self-configurable forms, you can subscribe to the newsletter, go through a registration process (also &lt;a href="https://webdeasy.de/en/double-opt-in-node-js/"&gt;double opt-in&lt;/a&gt; possible) and receive newsletters in the future. Of course, you can change your data at any time or unsubscribe from the newsletter completely.&lt;/p&gt;

&lt;p&gt;Thereby you can divide your subscribers into several lists to separate them e.g. by topic.&lt;/p&gt;

&lt;p&gt;Using a simple drag-n-drop builder, the newsletters can then be easily clicked together and saved as templates for the next newsletters. When you are satisfied, you choose a subject, check the newsletter with a test mail and then the newsletter can go out to your subscribers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ifKsFoYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/newsletter-create-650x270.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ifKsFoYS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/newsletter-create-650x270.jpg" alt="Create newsletter by drag-n-drop&amp;lt;br&amp;gt;
" width="650" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Statistics show you how your content is being received by your subscribers and what you might be able to improve in the future.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;For anyone who wants to build a community and provide their (blog) readers with regular updates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/newsletter/"&gt;Install Newsletter&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Polylang
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Category:&lt;/strong&gt; Feature // 600,000+ active installations&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NWk3_QBp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/polylang.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NWk3_QBp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/polylang.jpg" alt="Polylang language overview&amp;lt;br&amp;gt;
" width="800" height="134"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;here is not much to say about this plugin – and that in a positive sense. If you want to add more than one language to your website, Polylang is the right choice. It’s simple, works great and you can even replace other strings that are present on your website.&lt;/p&gt;

&lt;h3&gt;
  
  
  For whom is this plugin suitable?
&lt;/h3&gt;

&lt;p&gt;For anyone who wants to make their content available in multiple languages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/polylang/"&gt;Install Polylang&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure that your plugins always have the latest updates installed. Possible security gaps will be closed. Check every 7-14 days if updates are available. Alternative: You can activate automatic plugin updates under Plugins on the right side under Activate automatic updates.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  7. Useful tool plugins
&lt;/h2&gt;

&lt;p&gt;The next plugins are plugins that can be installed as needed and are rather small tools for specific tasks. Some of them you can also activate only temporarily when you need them to save resources.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 Regenerate Thumbnails
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Active installations:&lt;/strong&gt; 1+ Million&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Gw6WXsju--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/regenerate-thumbnails-610x650.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Gw6WXsju--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/regenerate-thumbnails-610x650.jpg" alt="Regenerate Thumbnails&amp;lt;br&amp;gt;
" width="610" height="650"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have reworked your site and need new SEO optimized image sizes this plugin is the right tool for you. It can (re)generate all media files or just the post images in all set image sizes. This has always worked very reliably for me, but you should create a backup beforehand to be on the safe side.&lt;/p&gt;

&lt;h4&gt;
  
  
  For whom is this plugin suitable?
&lt;/h4&gt;

&lt;p&gt;For anyone who needs to regenerate image sizes, for example when changing a theme or to improve SEO values.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/regenerate-thumbnails/"&gt;Install Regenerate Thumbnails&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Move WordPress site
&lt;/h3&gt;

&lt;p&gt;To move a WordPress site e.g. to a new domain you don’t need a plugin, you can simply follow this guide:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://webdeasy.de/wordpress-seite-umziehen-ohne-plugin/"&gt;Move WordPress website&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 Antispam Bee
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Active installations:&lt;/strong&gt; 700,000+&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pB1HHz5w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/antispam-bee.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pB1HHz5w--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/antispam-bee.jpg" alt="Antispam Bee statistics on my dashboard" width="800" height="248"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Antispam Bee is a small plugin that works in the background and blocks spam comments and trackbacks to keep your comments section clean.&lt;/p&gt;

&lt;p&gt;I was struggling with spam but that’s over. In “good” times Antispam Bee blocks about 100 spam comments from me – &lt;strong&gt;every day!&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--STbClP99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/antispam-bee-settings-650x487.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--STbClP99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://webdeasy.de/wp-content/uploads/2021/12/antispam-bee-settings-650x487.jpg" alt="https://webdeasy.de/wp-content/uploads/2021/12/antispam-bee-settings.jpg" width="650" height="487"&gt;&lt;/a&gt;&lt;br&gt;
Through further settings, blocked comments are also automatically deleted after a certain time. Familiar commenters are recognized and much more. The plugin is also “Developed with data protection and privacy in mind” according to developers.&lt;/p&gt;

&lt;h4&gt;
  
  
  For whom is this plugin suitable?
&lt;/h4&gt;

&lt;p&gt;For anyone who uses the comment and or trackback function on their page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;➡️ &lt;a href="https://wordpress.org/plugins/antispam-bee/"&gt;Move Antispam Bee&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not for all functionalities and features you necessarily need a WordPress plugin. With a few small code snippets you can achieve a lot. Please have a look at my article about &lt;a href="https://webdeasy.de/en/wordpress-code-snippets-en/"&gt;WordPress Snippets&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Thanks for reading! ❤️&lt;br&gt;
You are asked, without which plugin must not be a WordPress site with you?&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>webdev</category>
      <category>blog</category>
      <category>cms</category>
    </item>
    <item>
      <title>Code Smarter, Not Harder: How ChatGPT Can Simplify Your Coding Journey 🚀🔥</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Sat, 15 Apr 2023 13:19:51 +0000</pubDate>
      <link>https://dev.to/webdeasy/code-smarter-not-harder-how-chatgpt-can-simplify-your-coding-journey-2291</link>
      <guid>https://dev.to/webdeasy/code-smarter-not-harder-how-chatgpt-can-simplify-your-coding-journey-2291</guid>
      <description>&lt;p&gt;&lt;em&gt;ChatGPT is the hot shit among developers right now! In this article, I’ll show you how you can benefit from this AI tool as a developer. With practical examples and insider tips, I’ll show you how to speed up your development processes and make your life easier. So let’s get started!&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ❓ What is ChatGPT?
&lt;/h2&gt;

&lt;p&gt;What is ChatGPT? Good question. Is it a chatbot? A text generation tool? Or just another AI model that will soon make us developers obsolete? Let’s just ask it ourselves.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fwhat-is-chatgpt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fwhat-is-chatgpt.gif" alt="What is ChatGPT in 3 sentences?&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;br&gt;
Now, before you panic, let me explain: ChatGPT is indeed an AI model for text generation, but it’s so much more than that. It’s a general-purpose tool that can help you as a developer get your work done faster, more effectively, and even more creatively.&lt;/p&gt;

&lt;p&gt;But what is the secret of ChatGPT? Well, it’s based on a so-called Generative Pre-trained Transformer, or GPT for short. Sounds like a science fiction weapon, but it’s actually just an algorithm trained to generate natural language texts written by humans.&lt;/p&gt;

&lt;p&gt;And with ChatGPT you can use this powerful tool in your development process. But be careful! ChatGPT is not a panacea and should be used with care. What you have to pay attention to, you will learn now.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Curious now? Everyone can currently use ChatGPT for free. All you have to do is &lt;a href="https://openai.com/blog/chatgpt" rel="noopener noreferrer"&gt;create an account with your email address&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  👉 How can ChatGPT be used by developers?
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Develop code, scripts and snippets
&lt;/h3&gt;

&lt;p&gt;ChatGPT can help developers generate code, scripts and snippets automatically by typing short prompts. This can save time and effort. However, it is important to ensure that the generated code meets the requirements and is thoroughly tested before deploying it. ChatGPT can also act as a “code checker” and suggest improvements.&lt;/p&gt;

&lt;p&gt;In addition, ChatGPT can help with writing automated workflows. Overall, ChatGPT provides tremendous support for code development, but it is important to still have the skills and knowledge to write and optimize code from scratch.&lt;/p&gt;

&lt;p&gt;I prefer to use it when generating config files. There, many parameters are needed that are rarely used and therefore you don’t have them in your head. Recently I wanted to extend an existing CI/CD environment with a test phase. The existing script looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Node.js CI/CD Workflow with frontend&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;master"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;test-and-build&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;16.x&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Use Node.js ${{ matrix.node-version }}&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/setup-node@v3&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.node-version }}&lt;/span&gt;
        &lt;span class="na"&gt;cache&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;npm'&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build Frontend&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;npm i --prefix client &amp;amp;&amp;amp; npm run build --prefix client&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
       &lt;span class="na"&gt;CI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;

    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Push to build branch&lt;/span&gt;
      &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;s0/git-publish-subdir-action@develop&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;REPO&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;self&lt;/span&gt;
        &lt;span class="na"&gt;BRANCH&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;build&lt;/span&gt; &lt;span class="c1"&gt;# The branch name where you want to push the assets&lt;/span&gt;
        &lt;span class="na"&gt;FOLDER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;./public&lt;/span&gt; &lt;span class="c1"&gt;# The directory where your assets are generated&lt;/span&gt;
        &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt; &lt;span class="c1"&gt;# GitHub will automatically add this - you don't need to bother getting a token&lt;/span&gt;
        &lt;span class="na"&gt;MESSAGE&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Build:&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;({sha})&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{msg}"&lt;/span&gt; &lt;span class="c1"&gt;# The commit message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ChatGPT then reengineered the missing step for me. I simply passed the existing config file in the prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;...&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install dependencies and run tests&lt;/span&gt;
      &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
        &lt;span class="s"&gt;npm install&lt;/span&gt;
        &lt;span class="s"&gt;npm run test&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;CI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;# set environment variable to run tests in CI mode&lt;/span&gt;
&lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;...&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Writing documentation
&lt;/h3&gt;

&lt;p&gt;By simply asking ChatGPT for the documentation you want, you can have it generate structured documentation that covers all the important aspects of your code or project. Extensions for your IDE can also help with this. I will go into this in more detail later.&lt;/p&gt;

&lt;p&gt;However, it is important to ensure that the generated documentation is complete and understandable. One should also take the time to review it and edit it if necessary before passing it on to customers or users.&lt;/p&gt;

&lt;p&gt;I have a great example of this here. Imagine you are looking at another developer’s code and he didn’t pay attention to the naming of the functions and also didn’t create comments. By the time you look through the code, ChatGPT already has the solution for you. Or can you tell me within 10 seconds what this code does?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;whatDoesThisFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&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="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
                &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
    &lt;span class="n"&gt;sorted_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;whatDoesThisFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sorted_numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I asked ChatGPT to “Write comments in the code:”. This was the result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;whatDoesThisFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    This function takes in a list of numbers and sorts them using the bubble sort algorithm.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&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="nf"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)):&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
                &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# Swap the values if the jth element is smaller than the ith element.
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;  &lt;span class="c1"&gt;# Generate a list of 10 random integers between 1 and 100.
&lt;/span&gt;    &lt;span class="n"&gt;sorted_numbers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;whatDoesThisFunction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Call the function to sort the numbers.
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sorted_numbers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# Print the sorted list of numbers.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I think I do not need to say more 🙂&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Provide food for thought
&lt;/h3&gt;

&lt;p&gt;It can be frustrating to be stuck trying to solve a problem and run out of ideas. In such situations, ChatGPT can serve as a thought-provoking tool by suggesting alternative approaches and ideas. With its ability to analyze a wide range of information and recognize patterns, ChatGPT can often make unexpected and useful suggestions. While it may not always provide the perfect solution, it can help stimulate the creative process and find new ways to solve problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Test writing
&lt;/h3&gt;

&lt;p&gt;When it comes to writing tests, it can be very time-consuming and tedious. But with ChatGPT you can automate this tedious task and speed up your code development process.&lt;/p&gt;

&lt;p&gt;How does it work? By simply submitting a request to ChatGPT describing the test case you want to create. The AI engine will then automatically generate the test case code for you! This means less stress and faster code generation, so you can focus on other important tasks.&lt;/p&gt;

&lt;p&gt;I would like to demonstrate the whole thing to you. I have here code from a middleware of an existing Rest API:&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="c1"&gt;// Middleware to validate challenge parameters&lt;/span&gt;
&lt;span class="nx"&gt;validateChallenge&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;next&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Check if request body, challengeID, done and code are present and have expected data types&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;challengeID&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;done&lt;/span&gt;
  &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Please enter valid challenge params!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// Send error message if validation fails&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nf"&gt;next&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// Call next middleware function if validation passes&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we take this code and pass it to ChatGPT with the following prompt: “Write tests for this code: CODE“.&lt;/p&gt;

&lt;p&gt;With a single click, ChatGPT spits out a total of 5 test cases for our code.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fimage-2.png" alt="ChatGPT generates JavaScript test cases for a Rest API&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you already have other tests in your project you can of course tell ChatGPT to generate unit tests for a specific framework.&lt;/p&gt;

&lt;p&gt;Overall, ChatGPT can help you work more efficiently and simplify the test writing process. So why not outsource this tedious task to an AI and optimize your development time?&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Tips when using ChatGPT
&lt;/h2&gt;

&lt;p&gt;After using ChatGPT for quite a while now in my daily developer existence, I was able to find some tips &amp;amp; tricks when using ChatGPT.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Choose prompts correctly
&lt;/h3&gt;

&lt;p&gt;To get good results you have to tell ChatGPT exactly what you want. Write 1-2 sentences more in the prompt, but you will usually get better results.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The correct IDE extensions
&lt;/h3&gt;

&lt;p&gt;There are now numerous extensions available for all IDEs in marketplaces and stores. Just browse the stores. Since I personally use Visual Studio Code, I can only recommend the &lt;a href="https://github.com/ai-genie/chatgpt-vscode" rel="noopener noreferrer"&gt;Genie&lt;/a&gt; extension for it.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fvscode-geenie-extension.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2023%2F04%2Fvscode-geenie-extension.jpg" alt="Visual Studio Code: Genie Extension Beispiel&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Watch out for sensitive/secret data
&lt;/h3&gt;

&lt;p&gt;Developers often deal with sensitive data, such as user information or secret company data. As a developer, it is therefore crucial to ensure that this data is not accidentally exposed when working with ChatGPT.&lt;/p&gt;

&lt;p&gt;The best practice here is to provide only test data to ChatGPT. By making sure that no confidential information is used, you prevent accidental data leaks and keep your data safe.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. ChatGPT works better with examples
&lt;/h3&gt;

&lt;p&gt;Giving examples is an important step to improve the performance of ChatGPT. For example, if you ask ChatGPT to generate SQL queries or code, you will get better results if you provide concrete examples.&lt;/p&gt;

&lt;p&gt;By providing a few lines of SQL code or the structure of the table, ChatGPT can better understand what you need and can provide more accurate results. Similarly, if you want ChatGPT to comment code. By providing sample comments, ChatGPT can better understand what you need and can generate more accurate comments.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Use English language
&lt;/h3&gt;

&lt;p&gt;My native language is German, so it is easier for me to create German prompts. However, I have noticed that ChatGPT understands English prompts better and therefore gives better results. Pretty much all developer resources and documentation are in English, so ChatGPT naturally understands that better.&lt;/p&gt;

&lt;h2&gt;
  
  
  🐛 ChatGPT is not perfect – and makes mistakes!
&lt;/h2&gt;

&lt;p&gt;Although ChatGPT is an impressive example of AI text generation, it still makes mistakes. One of the main limitations of ChatGPT is that it is based on data from 2021, which means it may use outdated technologies and frameworks. For this reason, it is important that developers carefully review the generated code before running it to ensure that it is correct and secure.&lt;/p&gt;

&lt;p&gt;Another point to note is that ChatGPT cannot understand deep relationships between different programming technologies and concepts. It can generate code that is syntactically correct but may not have the desired functionality or efficiency. In such cases, it is important for the developer to use manual review and their own understanding of the underlying concepts and relationships to ensure that the generated code meets the requirements.&lt;/p&gt;

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

&lt;p&gt;In this day and age of technology and advancement, AI can be an incredibly valuable tool. ChatGPT, as one of the leading AI models, can help developers in a variety of ways – from developing code and scripts to writing tests and documentation.&lt;/p&gt;

&lt;p&gt;Of course, there are a few things to keep in mind when using ChatGPT, like choosing the right prompts and IDE extensions, and avoiding sensitive data in prompts. But that shouldn’t stop us from taking full advantage of the power of AI!&lt;/p&gt;

&lt;p&gt;Overall, ChatGPT is a useful assistant for any developer and can help save time and effort. However, if you rely too much on AI, there is a risk that you will be left like a fish out of water if the AI fails. Therefore, you should still have the necessary skills and knowledge to get the job done without ChatGPT.&lt;/p&gt;

&lt;p&gt;So, dear developers, don’t be too scared to use ChatGPT, but don’t forget that all that glitters is not gold. And now let’s all get back to our work and look our new AI assistants in the eye with enthusiasm!&lt;/p&gt;




&lt;p&gt;➡️ On &lt;a href="https://webdeasy.de/" rel="noopener noreferrer"&gt;my blog&lt;/a&gt; you can find many more tutorials and articles!&lt;/p&gt;

&lt;p&gt;Do you already use ChatGPT in Development or what are your thoughts on ChatGPT? Let me know it in the comments! 😁&lt;/p&gt;

&lt;p&gt;Thanks for reading! ❤️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;And yes: ChatGPT helped me with this article too&lt;/em&gt; 😲&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>productivity</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to build a Vue.js App without Node, Webpack, npm or build tools</title>
      <dc:creator>webdeasy.de</dc:creator>
      <pubDate>Sat, 09 Jul 2022 11:54:10 +0000</pubDate>
      <link>https://dev.to/webdeasy/how-to-build-a-vuejs-app-without-node-webpack-npm-or-build-tools-2b57</link>
      <guid>https://dev.to/webdeasy/how-to-build-a-vuejs-app-without-node-webpack-npm-or-build-tools-2b57</guid>
      <description>&lt;p&gt;&lt;em&gt;I love Vue.js and for larger applications the development with Node.js is quite feasible. However, if you want to build a “normal” website it’s often a lot of effort you don’t want to have. But even without webpack or other build tools it is quite easy to do!&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;If you simply want to place a small or medium sized Vue application on your website, it is often unnecessary effort to create a project with the Vue CLI, develop it and then integrate the finished build into your website. A small application on a WordPress site and such an effort? It doesn’t have to be.&lt;/p&gt;

&lt;p&gt;On many websites &lt;a href="https://webdeasy.de/en/jquery-to-javascript/" rel="noopener noreferrer"&gt;jQuery&lt;/a&gt; is used. I think many don’t know that it is just as easy to use Vue.js for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vue.js without build tools &amp;amp; co.? The solution: Vue SFC Loader
&lt;/h2&gt;

&lt;p&gt;For a long time I only used jQuery on websites, because I simply didn’t know this way. However, after a long research and a lot of trial and testing, I found a simple solution that works very easily and reliably: &lt;a href="https://github.com/FranckFreiburger/vue3-sfc-loader" rel="noopener noreferrer"&gt;&lt;strong&gt;Vue3 SFC Loader&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This script is able to load &lt;code&gt;.vue&lt;/code&gt; files at runtime – without the need of a Node.js environment. So you don’t need a bundler and also no build tools which have to be executed before the execution.&lt;/p&gt;

&lt;p&gt;In the Vue.js documentation there is also a section about “&lt;a href="https://vuejs.org/guide/quick-start.html#without-build-tools" rel="noopener noreferrer"&gt;Without Build Tools&lt;/a&gt;“. For very small applications with only one main component this also works. For larger applications this unfortunately did not work for me, so that script attribute &lt;code&gt;importmap&lt;/code&gt; is &lt;a href="https://caniuse.com/import-maps" rel="noopener noreferrer"&gt;not supported&lt;/a&gt; by all browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages and disadvantages
&lt;/h2&gt;

&lt;p&gt;An obvious advantage is that the complexity of the environment (Vue CLI, Node Server, etc.) is greatly reduced. In addition, you do not have to “recompile” the entire application after each change and push it to Production. So for small and medium sized applications and when using a CMS or simply small websites, this is a real alternative.&lt;/p&gt;

&lt;p&gt;But that brings us directly to the disadvantages: If you want to create a single page application (SPA) you should still use the Vue CLI. In general, I would still prefer it for larger, standalone applications. With a good CI/CD workflow, the deployment of the application is then also well feasible.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vue.js App without Build Tools – Example App
&lt;/h2&gt;

&lt;p&gt;I built a small Vue application to show as many different features of Vue as possible. The app consists of 2 components: Main Component and Footer.&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/zue0rt"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let’s go through the individual functions step by step:&lt;/p&gt;

&lt;h3&gt;
  
  
  Basic structure (with several Vue Components)
&lt;/h3&gt;

&lt;p&gt;The basic structure consists of an HTML file, a JS file in which the Vue Components are registered and the three Vue Components.&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;!-- index.html --&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vue Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-main-component&amp;gt;&amp;lt;/vue-main-component&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-footer&amp;gt;&amp;lt;/vue-footer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/vue@latest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/vue3-sfc-loader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/vue-app.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This JavaScript file contains a JavaScript object with data and functions that are needed for the Vue SFC Loader. Therefore, you can simply take this part and only adjust the marked Vue Components for your project below.&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="c1"&gt;// js/vue-app.js&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createApp&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue3-sfc-loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;moduleCache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;vue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;getFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&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="nf"&gt;addStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;styleStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;style&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styleStr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;style&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;args&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;VueMainComponent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;js/vue-components/vue-main-component.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;VueFooter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;js/vue-components/vue-footer.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&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="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Footer Component
&lt;/h4&gt;

&lt;p&gt;The Footer component also contains only text at the beginning. In a later section I will show how to use scoped CSS here.&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;!-- js/vue-components/vue-footer.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the footer with custom scoped CSS.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Main Component
&lt;/h4&gt;

&lt;p&gt;In the main component I have summarized the main logic. In general, you can make the division as you want or put everything in a single component.&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;!-- js/vue-components/vue-main-component.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ headline }}&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component Headline&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="nf"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component mounted&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="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It includes a &lt;code&gt;{{ headline }}&lt;/code&gt; variable that displays plain text and a JavaScript &lt;code&gt;alert()&lt;/code&gt; that is executed once the component is mounted.&lt;/p&gt;

&lt;p&gt;We will now extend this component with further functions in the next chapters.&lt;/p&gt;

&lt;h3&gt;
  
  
  Events &amp;amp; Methods
&lt;/h3&gt;

&lt;p&gt;For example, we add a new button with a click event. When the button is clicked, the &lt;code&gt;doAxiosRequest()&lt;/code&gt; function is executed. Don’t be confused by the name, in the next step we add the package Axios.&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;!-- js/vue-components/vue-main-component.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ headline }}&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"doAxiosRequest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Load random dog image&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;:src=&lt;/span&gt;&lt;span class="s"&gt;"dogImage"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component Headline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;dogImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&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;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;doAxiosRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dogImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://images.dog.ceo/breeds/pembroke/n02113023_436.jpg&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="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component mounted&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="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Do you know my &lt;a href="https://webdeasy.de/en/topics/?ref=dev-2b57" rel="noopener noreferrer"&gt;blog&lt;/a&gt; and &lt;a href="https://webdeasy.de/en/newsletter-en/?ref=dev-2b57" rel="noopener noreferrer"&gt;newsletter&lt;/a&gt;? There I have already published many tutorials on web development. Would be happy if we meet there! 😋&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Packages
&lt;/h3&gt;

&lt;p&gt;External packages/modules can also be used without build tools. In many applications Axios is used to make asynchronous server requests. With this example I will demonstrate how to include such packages.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2022%2F07%2Fexample-application-with-dog-e1657204489435.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwebdeasy.de%2Fwp-content%2Fuploads%2F2022%2F07%2Fexample-application-with-dog-e1657204489435.jpg" alt="Vue.js app example with random dog image&amp;lt;br&amp;gt;
"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To load a package, we just need to add the link in line 17 to our &lt;strong&gt;index.html&lt;/strong&gt;:&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;!-- index.html --&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vue Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-main-component&amp;gt;&amp;lt;/vue-main-component&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-footer&amp;gt;&amp;lt;/vue-footer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/vue@latest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/vue3-sfc-loader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/axios/dist/axios.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/vue-app.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we can access all the functionality directly through the &lt;code&gt;axios&lt;/code&gt; variable. In this example we load a random dog image into the &lt;code&gt;img&lt;/code&gt; tag.&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;!-- js/vue-components/vue-main-component.vue --&amp;gt;&lt;/span&gt;

...
    doAxiosRequest: function () {
      axios.get('https://dog.ceo/api/breeds/image/random').then((response) =&amp;gt; {
        this.dogImage = response.data.message;
      });
    },
  },
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Props (Properties)
&lt;/h3&gt;

&lt;p&gt;Props are attributes that we can pass when including our components. They can be fixed or dynamic attributes. In the example, I simply passed the static text “Foobar”.&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;!-- index.html --&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vue Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-main-component&lt;/span&gt; &lt;span class="na"&gt;msg=&lt;/span&gt;&lt;span class="s"&gt;"Foobar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/vue-main-component&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-footer&amp;gt;&amp;lt;/vue-footer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/vue@latest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/vue3-sfc-loader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/axios/dist/axios.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/vue-app.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In our main component we now add a new button that calls the &lt;code&gt;clickButton()&lt;/code&gt; function when clicked. We also need to register the property as a string. In the &lt;code&gt;clickButton()&lt;/code&gt; function we can then retrieve the value with &lt;code&gt;this.msg&lt;/code&gt;.&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;!-- js/vue-components/vue-main-component.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ headline }}&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"clickButton"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Show the msg property!&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"doAxiosRequest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Load random dog image&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;:src=&lt;/span&gt;&lt;span class="s"&gt;"dogImage"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component Headline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;dogImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&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;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;clickButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;msg property: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;doAxiosRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dog.ceo/api/breeds/image/random&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dogImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&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="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component mounted&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="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Scoped CSS
&lt;/h3&gt;

&lt;p&gt;With Scoped CSS CSS properties can be defined only for the current component. To do this, the CSS style tag must also have the scoped attribute.&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;!-- js/vue-components/vue-footer.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the footer with custom scoped CSS.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;scoped&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Full Code
&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;!-- index.html --&amp;gt;&lt;/span&gt;

&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang=&lt;/span&gt;&lt;span class="s"&gt;"en"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;charset=&lt;/span&gt;&lt;span class="s"&gt;"UTF-8"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Vue Test&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"app"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-main-component&lt;/span&gt; &lt;span class="na"&gt;msg=&lt;/span&gt;&lt;span class="s"&gt;"Foobar"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/vue-main-component&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;vue-footer&amp;gt;&amp;lt;/vue-footer&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/vue@latest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.jsdelivr.net/npm/vue3-sfc-loader"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/axios/dist/axios.min.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"./js/vue-app.js"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// js/vue-app.js&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;createApp&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;loadModule&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;vue3-sfc-loader&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;moduleCache&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;vue&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;getFile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ok&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;resp&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="nf"&gt;addStyle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;styleStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;style&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;styleStr&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;style&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;insertBefore&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;args&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;VueMainComponent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;js/vue-components/vue-main-component.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;VueFooter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;js/vue-components/vue-footer.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&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="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;!-- vue-components/vue-main-component.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;{{ headline }}&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"clickButton"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Show the msg property!&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;button&lt;/span&gt; &lt;span class="err"&gt;@&lt;/span&gt;&lt;span class="na"&gt;click=&lt;/span&gt;&lt;span class="s"&gt;"doAxiosRequest"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Load random dog image&lt;span class="nt"&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;br&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;:src=&lt;/span&gt;&lt;span class="s"&gt;"dogImage"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;headline&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component Headline&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;dogImage&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;undefined&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;props&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;methods&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;clickButton&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;msg property: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;doAxiosRequest&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;function &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;axios&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://dog.ceo/api/breeds/image/random&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;dogImage&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&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="p"&gt;},&lt;/span&gt;
  &lt;span class="nf"&gt;mounted&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;alert&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Vue Main Component mounted&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="p"&gt;};&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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;!-- vue-components/vue-footer.vue --&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;template&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is the footer with custom scoped CSS.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/template&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;style &lt;/span&gt;&lt;span class="na"&gt;scoped&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using Vue.js without build tools in WordPress
&lt;/h2&gt;

&lt;p&gt;I work a lot with &lt;a href="https://webdeasy.de/en/best-wordpress-plugins/?ref=dev-2b57" rel="noopener noreferrer"&gt;WordPress&lt;/a&gt; and would like to be able to use Vue.js there as well to the same extent. You can keep the structure of the files also in WordPress. Additionally I wrote a small &lt;a href="https://webdeasy.de/en/wordpress-code-snippets-en/" rel="noopener noreferrer"&gt;code snippet&lt;/a&gt; for &lt;strong&gt;functions.php&lt;/strong&gt; to load Vue, the SFC loader and the main JS file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;setup_vue_app&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// latest vue version&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"vuejs"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'https://unpkg.com/vue@latest'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
    &lt;span class="c1"&gt;// sfc-loader for vue&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"vue3-sfc-loader"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'https://cdn.jsdelivr.net/npm/vue3-sfc-loader'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'vuejs'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  
    &lt;span class="c1"&gt;// main vue js file to register all components&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"vue-app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;get_stylesheet_directory_uri&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'/js/vue-app.js'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'vuejs'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'vue3-sfc-loader'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;    
    &lt;span class="c1"&gt;// includes the path to your vue files into vue-app.js&lt;/span&gt;
    &lt;span class="nf"&gt;wp_localize_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"vue-app"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"WPVars"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"vueFiles"&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;get_stylesheet_directory_uri&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s1"&gt;'/js/vue-components'&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="c1"&gt;// load packages (e.g. axios)&lt;/span&gt;
    &lt;span class="nf"&gt;wp_enqueue_script&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"vue-axios"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'https://unpkg.com/axios/dist/axios.min.js'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'vuejs'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'vue3-sfc-loader'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nf"&gt;add_action&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'wp_enqueue_scripts'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'setup_vue_app'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make the path to our Vue files dynamic a small adjustment in vue-app.js is necessary:&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="c1"&gt;// js/vue-app.js&lt;/span&gt;
&lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createApp&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;components&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;VueMainComponent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;WPVars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vueFiles&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/vue-main-component.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="na"&gt;VueFooter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Vue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;defineAsyncComponent&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
      &lt;span class="nf"&gt;loadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;WPVars&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;vueFiles&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/vue-footer.vue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;options&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="p"&gt;}).&lt;/span&gt;&lt;span class="nf"&gt;mount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#app&lt;/span&gt;&lt;span class="dl"&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 that’s all. Now you can use Vue.js with your WordPress website.&lt;/p&gt;

&lt;p&gt;If you’re new to Vue.js, here are a few &lt;a href="https://webdeasy.de/en/3-practical-examples-vue-js/" rel="noopener noreferrer"&gt;sample projects to help you learn Vue.js&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Thanks for reading! ❤️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;➡️ &lt;a href="https://webdeasy.de/en/topics/?ref=dev-2b57" rel="noopener noreferrer"&gt;On my blog&lt;/a&gt; you can find many more tutorials and articles!&lt;/em&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>vue</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
