使用 Rust 构建 Web API(高级)
Rustaceans的后端Web开发
教程演示🔗
What you’ll learn 学习内容
-
Implementing an authentication service in a Rocket REST API
在 Rocket REST API 中实现身份验证服务 -
Managing database entities with complex fields and relationships using async Diesel and PostgreSQL
使用异步 Diesel 和 PostgreSQL 管理具有复杂字段和关系的数据库实体 -
Implementing a cache database with Redis
使用 Redis 实现缓存数据库 -
Session handling and granular access management for different endpoints
针对不同端点的会话处理和精细访问管理 -
Testing API endpoints in an automated way
以自动化方式测试 API 端点 -
Sending HTML emails with lettre and tera
使用 lettre 和 tera 发送 HTML 电子邮件 -
Writing CLI commands with clap
使用 clap 编写 CLI 命令
Requirements 要求
-
Good knowledge of Rust 良好的 Rust 知识
-
Familiarity with docker and docker-compose
熟悉 docker 和 docker-compose -
Understanding of HTTP, REST and JSON
了解HTTP、REST和JSON -
Experience with SQL and ORMs in general
一般具有 SQL 和 ORM 的经验
Description 描述
Rust is a systems programming language which you can use to write applications with high performance. It is amazingly refreshing with a very helpful compiler who is your mentor since the very beginning.
Rust 是一种系统编程语言,可用于编写高性能应用程序。一个非常有帮助的编译器令人耳目一新,他从一开始就是你的导师。
Cargo is not only a package manager but also a build tool, a documentation generator and a lot more, making your every day managing Rust apps really easy.
Cargo 不仅是一个包管理器,还是一个构建工具、一个文档生成器等等,让你每天管理 Rust 应用程序变得非常容易。
It is no wonder that for these reasons, plus many more, Rust was voted as StackOverflow’s most loved and desired programming language, eight years in a row.
难怪由于这些原因,再加上其他原因,Rust 连续八年被评为 StackOverflow 最受欢迎和最渴望的编程语言。
You have already spent a good amount of time developing web applications and you have a very good understanding of Rust.
你已经花了很多时间开发 Web 应用程序,并且你对 Rust 有很好的了解。
You are beyond the point of simple, toy applications and you are ready to start doing some serious back-end web development and you are wondering whether Rust can be used for this purpose.
你已经超越了简单的玩具应用程序,你已经准备好开始做一些严肃的后端 Web 开发,你想知道 Rust 是否可以用于此目的。
You are looking for a resource that has all you need in a single place.
您正在寻找一种在一个地方拥有您需要的一切的资源。
Well, look no further! In this course i will show you how to create a complex, fully async web app in Rust that serves JSON APIs but also has a CLI interface at the same moment.
好吧,不要再看了!在本课程中,我将向您展示如何在 Rust 中创建一个复杂的、完全异步的 Web 应用程序,该应用程序提供 JSON API,但同时也具有 CLI 接口。
We will use the Rocket web framework along with the Diesel ORM to build Rest APIs with
我们将使用 Rocket Web 框架和 Diesel ORM 来构建 Rest API
– Authentication built-in (users and passwords)
– 内置身份验证(用户和密码)
– Redis as a cache storage
– Redis 作为缓存存储
– Access management with roles
– 使用角色进行访问管理
– Handling for datetime fields
– 日期时间字段的处理
– CLI commands – CLI 命令
– Logging -伐木
– Automated API testing – 自动化 API 测试
Who this course is for:
本课程适用于谁:
- Web developers looking to build a Rust server for advanced cases
希望为高级案例构建 Rust 服务器的 Web 开发人员 - Web developers looking into building very fast and reliable servers
希望构建非常快速和可靠的服务器的 Web 开发人员