According to the official documentation, it provides the following functionalities:
Jest is a great testing toolkit for developers who are looking for other alternatives and have experience with the following testing frameworks:
Let’s proceed to the next section and start installing Jest.
Installation is pretty straightforward via either yarn or npm, based on your own preferences. …
This tutorial focuses on the comparison between two main packages for calling API requests in Python.
The first is Requests: HTTP for Humans, which is one of the most common packages used by developers. It is a fairly simple and straightforward HTTP library for Python. Besides, it provides great support for HTTP 1.1 and full automation of HTTP connection pooling.
On the other hand, aiohttp, is an asynchronous HTTP framework for both client and server. It was designed to make the most out of network operations in a non-blocking way. In addition, most of the servers are now built using ASGI servers. Calling APIs asynchronous provides an edge in terms of performance especially when I/O operations make up the majority of the processes in your project. …
I have covered an article previously on Weighing the Pros and Cons of Static Application Security Testing. My previous article covers the Top 10 most critical web application and API security risks faced by the developers all over the world based on the report produced by OWASP: a non-profit organization that aims to educate people on security vulnerabilities.
In this tutorial, we are going to explore and compare the differences between Static Application Security Testing (SAST) and Dynamic Application Security Testing (DAST).
Static Application Security Testing (SAST) is one of the method for reducing the security vulnerabilities in your application. Another method is Dynamic Application Security Testing (DAST), which secures your application. …
In this tutorial, I am going to demystify the concept behind dependency injection in FastAPI. For your information, FastAPI now comes with its own built-in dependency injection system which allows you to integrate components easier when building your API.
Dependency injection is a concept in programming where an object receive other objects that it depends on. The other objects are called dependencies. This minimizes code repetition and makes it easier to do testing on your systems.
Based on the official documentation, dependency injection provides the ability to
By reading this piece, you’ll learn to perform load and stress testing on your RESTful API using a free and open-source load-testing tool called k6. k6 was previously known as Load Impact and is a full-fledged tool for:
The topic for today is setting up your own bot in Telegram and deploying it locally via a method called polling. This means you can develop and test your bot in your server, as long as it is connected to the internet.
https is not required for this, which allows you to kickstart your project right away. You can always scale your project later by configuring your server with
https and linking it to Telegram via a webhook.
In this article, you will learn to:
Utilizing WebSockets, Queue and APScheduler for batch processing in FastAPI
In this tutorial, I am going to share a simple experiment that I have conducted over the weekend. The basic idea is to queue up all the incoming requests and process them in batches at certain interval each time. To do so, we are going to
The architecture is fairly straightforward and good enough for our case study. Please be reminded that if you are looking for production-ready solutions, you should be using RabbitMQ (message broker) or Celery (distributed task queue) instead based on your use cases. …
One simple trick to make your life easier
By reading this piece, you will learn to create a bash script that automates the restart process for your FastAPI server (production). As you have known, you can restart the server by using the reload argument during development.
uvicorn myapp:app --reload
When FastAPI (uvicorn ASGI) detects changes in the files, it will trigger a reload for you. However, you should not use the
reload argument for the production server. This is simply because it will hog your CPU resources in order to detect changes to the local files.
Most of the time, you are going to deploy it using
& argument which allows the process to continue running in the background. As a result, there might arise situations in which you just want to restart FastAPI…
10000 to 10K | 999999 to 1M | 1234567890 to 1.23B
By reading this piece, you will learn to format an integer (123456) into its own string representation (123K) in Python. This helps to improve the user experience in your application as displaying the number as string representation is a lot more coherent to the users. In this tutorial, I am going to showcase two different implementations:
Having said that, this article does not cover string representation that is less than 0 such as micro and nano. …
Build a monitoring dashboard with AJAX, Promise and React Hooks
By reading this piece, you will learn to create a simple React-based monitoring dashboard which shows the air quality information based on a city selected by the users. Here is an example of the monitoring dashboard.