backend

JWT security for a Rust REST API: how to

In this article, we will learn how to implement JWT security for a Rust REST API Server. At the end of this article, we will have a web server that has an endpoint for authenticating users, which will return a JWT. Clients are then able to use this JWT to gain access to the protected endpoint of our API. This article deals with similar concepts as two previous tutorials but combines them into one project. Here are the two previous tutorials: How to build a Rust REST API with warp How to use JWT with Rust: learn the basics here…

Rust

How to build a REST API server with Rust and warp

In this tutorial, we are going to build a simple Rust REST API using the warp crate. We will learn how to handle simple create, read, update, and delete operations on an in-memory “database”. This tutorial has some similarities with an earlier tutorial that was also using warp. The full code example for this tutorial can be found on my GitHub: here. I also have an article explaining how to implement authentication with warp and JSON Web Tokens: JWT security for a Rust REST API: how to. If you are interested in using WebSockets with warp give it a read:…

Warp data update loop: easy how to

What does “Rust Warp data update loop” mean? This article will describe how to create an infinite loop that sends data to clients connected to your WebSocket server in a thread separate from the main thread. This is useful when you want to build a system that periodically retrieves data from one or more sources and then needs to actively push that data to your client application. For example, a frontend dashboard that displays the data. The completed code project can be found on my GitHub, click here. This article will use the project from the following article: Rust Warp…

Rust Warp WebSocket server: learn how to now

In this article we will build a WebSocket server with Rust, using the warp framework. We will slowly go through the code building a simple version at first, and then add a bit more functionality to it. At the end of this article, we will be able to receive messages from the client and send something back in response. We will use this project as a base for future articles to build upon. We add a continuous data update loop to this project in the follow-up article Warp data update loop: easy how to. The repository with the complete Rust…

Easily connect to Binance WebSocket streams with Rust

In this article, we will look at how to connect to Binance WebSocket streams with Rust. We will be using the tungstenite library to make a WebSocket connection. For this tutorial, we will only use the public market data channels, so there is no need to register for an API key. Go to my Github to find the complete project here. This article is one of the first steps in a series of articles for building a triangle arbitrage dashboard using Binance cryptocurrency trading streams. Other articles in this series: The next step can be found at: Rust Warp WebSocket…