使用Rust+Rocket+Diesel+MySQL构建API应用
前置条件 本机已经安装好 Rust 开发环境 本机 VsCode 已经安装好开发插件 创建工程 web-hook-rs cargo new web-hook-rs cd web-hook-rs 添加依赖 编辑 Cargo.toml 文件并添加项目依赖: [package] name = "web-hook-rs" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] # 快速的 Web Api 框架 rocket = { version = "0.5.0", features = ["json"] } # 读取配置信息工具包 config = "0.14.0" # 数据库 ORM,支持 mysql diesel = { version = "2.1.0", features = ["mysql", "chrono"] } # 读取 .env 配置工具包 dotenvy = "0.15"……