Skip to main content

在 Shuttle 上托管

Shuttle Logo

Shuttle 是一个原生支持 Rust 的云开发平台,让你可以免费部署你的 Rust 应用。

Shuttle 开箱即用地支持 Actix Web。按照以下步骤在 Shuttle 上托管你的 Web 服务:

  1. Cargo.toml 中添加 Shuttle 依赖:

  1. 添加 #[shuttle_runtime::main] 注解并更新 main 函数如下:

  1. 安装 cargo-shuttle
cargo install cargo-shuttle
  1. 在 Shuttle 平台上创建你的项目:
cargo shuttle project start
  1. 部署!🚀
cargo shuttle deploy

你可以运行 cargo shuttle run 在本地测试你的应用。

查看一些完整的 Actix Web 示例 这里