|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/rest-api-server-rust-rocket-seaorm-jwt/
课程评论:没有评论
课程名称:使用Rust、Rocket、SeaORM和JWT创建API服务器 课程概述:在本课程中,我们将使用Rust创建一个代表书店的REST API服务器。这个书店系统将允许我们添加书籍和作者。通过这个系统,我们能够实现以下功能:创建、列出、更新和删除作者;创建、列出、更新和删除书籍;关联和解除书籍与作者之间的关系;按特定作者列出所有书籍。 我们将学习以下内容: - 使用Cargo创建新的Rust项目; - 构建和运行我们的Rust项目; - 添加依赖库(crates)并启用特性。 此外,我们会了解基本的API概念,例如: - 路由和HTTP方法; - 从HTTP请求中提取数据; - 与数据库交互以查询和插入数据; - 创建用户帐户; - 使用JWT进行身份验证; - 创建和使用模型之间的关系以查询和列出关联数据。 除此之外,我们还将学习: - 以安全的方式处理传入(请求)和传出(响应)数据; - 处理跨域资源共享(CORS); - 创建和运行数据库迁移; - 创建一对多的数据库关系; - 从数据库表中创建实体。 在课程的最后,会有一节额外的讲座,教你如何将我们的API服务器Docker化,以便在任何地方部署和运行。 我们将使用以下依赖库: - Rocket:Rust的一个Web框架,使得编写快速、安全的Web应用变得简单,同时不牺牲灵活性、可用性或类型安全性; - SeaORM:一个关系型ORM,帮助你在Rust中构建Web服务; - jsonwebtoken:以强类型方式创建和解码JWT; - serde_json:高效且通用地序列化和反序列化Rust数据结构。
In this course, we'll create a REST API server in Rust to represent a bookstore. This bookstore would allow us to add books and authors. Using this system, we'll be able to:Create, list, update and delete authorsCreate, list, update and delete booksAssociate and disassociate books and authorsList all books by a particular authorWe'll learn how to:Create a new Rust project using cargoBuild and run our Rust projectAdd crates and enable crate featuresWe'll learn about basic API concepts such:Routing and HTTP methodsExtracting data from HTTP requestsInteracting with the database to query and insert dataCreating user accountsAuthentication using JWTCreating and using relationships between models to query and list associated dataAlong with these concepts, we'll learn how to:Handle incoming (request) and outgoing (response) data in a type safe wayHandle CORSCreate and run database migrationsCreate one-to-many database relationshipsCreate entities from database tablesWe'll have a bonus lecture at the end to learn how to Dockerize our API server to deploy and run it anywhere.We'll be using the following crates:Rocket: a web framework for Rust that makes it simple to write fast, secure web applications without sacrificing flexibility, usability, or type safety.SeaORM: is a relational ORM to help you build web services in Rust.jsonwebtoken to create and decode JWTs in a strongly typed way.serde_json for serializing and deserializing Rust data structures efficiently and generically.