Show number of tests executed and passed in SonarQube with Jest, Vitest and Pytest

Show number of tests executed and passed in SonarQube with Jest, Vitest and Pytest

Tiempo de lectura: 2 minutos Today we are going to learn how to pass and display the number of tests that have been covered in SonarQube. For React with Vite: First, we install: npm install -D vitest-sonar-reporter Now, we go to the vitest.config.ts We add: html reporters: [‘default’, ‘vitest-sonar-reporter’], // JUnit reporter to generate test reports outputFile: ‘test-results/test-results.xml’, // XML … Read more

Verify Google Auth Token (Google Sign) Using Python

Verify Google Auth Token (Google Sign) Using Python

Tiempo de lectura: 2 minutos Today we’re going to learn how we can verify a token generated with Google Sign-In from a front-end client by sending it to the back-end. In this case, we’ll be using Python. Returns only the HTML translated, without any addition. Here’s a step-by-step tutorial for validating a Google Sign-In token in Python using the google-auth … Read more

Send Push Notifications to Google Firebase Cloud Messaging API (V1) Using Python

Send Push Notifications to Google Firebase Cloud Messaging API (V1) Using Python

Tiempo de lectura: 2 minutos Today we are going to learn how we can send a message to the Firebase Cloud Messaging endpoint using Python. (https://firebase.google.com/docs/cloud-messaging/http-server-ref?hl=en-419) For this, we need the Google endpoint: POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send And previously we have to generate a token in our application, for this we go to Firebase, select our project, and click on Project Settings: … Read more

Creating a WebSocket with FastAPI

Creating a WebSocket with FastAPI

Tiempo de lectura: < 1 minuto Today we are going to learn how we can quickly and easily generate a websocket with FastAPI. Step 1: Environment Setup, if you already have FastAPI installed, you can skip these steps. Make sure you have Python installed on your system. Then, install FastAPI and Uvicorn using pip: pip install fastapi uvicorn Step 2: Create … Read more

Verify Google Auth Token (Google Sign) Using Python

Verify Google Auth Token (Google Sign) Using Python

Tiempo de lectura: 2 minutos Today we’re going to learn how we can verify a token generated with Google Sign-In from a front-end client by sending it to the back-end. In this case, we’ll be using Python. Of course, here’s a step-by-step tutorial for validating a Google Sign-In token in Python using the google-auth library. Step 1: Install the google-auth … Read more

Send PUSH Notifications to Google Firebase Cloud Messaging API (V1) using Python

Send PUSH Notifications to Google Firebase Cloud Messaging API (V1) using Python

Tiempo de lectura: 3 minutos Today we are going to learn how we can send a message to the Firebase Cloud Messaging endpoint using Python. (https://firebase.google.com/docs/cloud-messaging/http-server-ref?hl=es-419) For this, we need the Google endpoint: POST https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send And previously we have to generate a token in our application, for this we go to Firebase, select our project, and click on Project Settings: … Read more

Creating a websocket with FastAPI

Creating a websocket with FastAPI

Tiempo de lectura: 2 minutos Today we are going to learn how we can quickly and easily generate a websocket with FastAPI. Step 1: Environment Setup, if you already have FastAPI installed, you can skip these steps. Make sure you have Python installed on your system. Then, install FastAPI and Uvicorn using pip: pip install fastapi uvicorn Step 2: Create … Read more

Complete Guide to HTTP Status Codes: Understanding Web Server Messages

Tiempo de lectura: 2 minutos Good morning! And happy holidays! 🎄 Today I bring you a basic tutorial about HTTP status codes. It’s always good to have them handy, so here are the most common ones! Common HTTP status codes: 200 OK: The request has been successfully processed. 400 Bad Request: Error in the client’s request. It could be due … Read more

Deploying a Python Web Application with Docker and Flask

Deploying a Python Web Application with Docker and Flask

Tiempo de lectura: < 1 minuto In this tutorial, we will learn how to use Docker to deploy a basic Python web application using the Flask framework. :snake: Step 1: Project Structure Create a new folder named “MyAppFlask” in your project directory and navigate to it: mkdir ~/projects/MyAppFlask cd ~/projects/MyAppFlask Step 2: Flask Application Code Create a file named app.py with … Read more

Encrypt a file and get it decrypted using FAST-API

Encrypt a file and get it decrypted using FAST-API

Tiempo de lectura: 2 minutos Today we are going to learn how to store an encrypted file and how to decrypt it to return it in a response. We will use the Fernet library. pip install cryptography First, let’s create an encryption key with Fernet. def generate_key(): key = Fernet.generate_key() return key.decode(‘utf-8’) With this function, we can obtain a random … Read more