Web APIs in Rust

Web APIs in Rust

1h 16mIntermediate2024-12-20

Authors

Tim McNamara

Tim McNamara

Rust Software Architect and Author

Course details

Rust is an extremely powerful and often intimidating language, but it’s particularly well-suited for web services. In this course, instructor Tim McNamara shows you how to get started building and deploying web services written in Rust. Learn how to use the Actix Web framework to create a service that can receive a payload via an HTTP POST request, process it and return JSON. Along the way, you’ll also explore the essentials of stateful endpoints, monitoring and observability, telemetry, testing, deployment, and much more.

Learning objectives
Understand the considerations involved in creating a web service in Rust.
Create JSON from Rust data and send it as an HTTP response body.
Accept JSON as the request of a HTTP POST body, and convert it to a Rust response.
Add observability to a web service that's written in Rust.

Skills covered

RustAPIsProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off

Concepts

Introduction

  • Harness the power of Rust
  • What you should know
  • Using Codespaces with this course

About the Tech Stack

  • Why Rust for web services
  • Introduction to Actix Web

Stateless Endpoints

  • Creating a health check endpoint
  • Receiving a payload via HTTP POST
  • Receiving a payload encoded as JSON

Stateful Endpoints

  • Adding global state
  • Adding authentication
  • Connecting to a database

Monitoring and Observability

  • Testing the endpoints
  • Adding telemetry

Deployment

  • Local-first deployment
  • Cloud-native deployment

Conclusion

  • Next steps
40,000 Toman