issues
search
hhstore
/
blog
My Tech Blog: about Mojo / Rust / Golang / Python / Kotlin / Flutter / VueJS / Blockchain etc.
https://github.com/hhstore/blog/issues
294
stars
24
forks
source link
Rust: Web Framework - Rocket
#370
Open
hhstore
opened
2 years ago
hhstore
commented
2 years ago
related:
[x] #347
[x] #369
[x] #368
[x] #364
hhstore
commented
2 years ago
Rocket:
https://github.com/topics/rocket?l=rust
前言:
调研了一堆 axum 等, 绕了一圈, 还是回到 rocket.
尝鲜, 是有成本的. 新项目(axum)的发展很漫长.
还是遵循市场规则. 社区主流选择, 还是 rocket.
官方:
https://rocket.rs/
https://github.com/SergioBenitez/Rocket
https://rocket.rs/v0.5-rc/guide/introduction/#foreword
关于异步支持:
https://github.com/SergioBenitez/Rocket/discussions/1672
https://rocket.rs/v0.5-rc/guide/upgrading/
同样基于 tokio
特性:
借鉴了 rails/flask 等特性.
API 使用友好.
支持异步
性能一般
生态最丰富.
开源社区大量项目使用 rocket 开发.
Rocket 插件:
https://crates.io/search?q=rocket
非常丰富.
ref:
https://github.com/neatfx/rust-rocket
https://www.zhihu.com/question/54504087
https://www.v2ex.com/t/843579
https://www.bilibili.com/video/BV1i44y1t7wp
一个投票:
https://www.reddit.com/r/rust/comments/macf2u/rocket_or_actix_web_in_2021/
https://kerkour.com/rust-web-framework-2022
https://youtu.be/GAxxn_oGA0Y
性能对比:
https://cloud.tencent.com/developer/article/1499602
hhstore
commented
2 years ago
Rocket 文档:
异步路由:
https://rocket.rs/v0.5-rc/guide/overview/#async-routes
请求:
https://rocket.rs/v0.5-rc/guide/requests/#requests
响应:
https://rocket.rs/v0.5-rc/guide/responses/
state:
https://rocket.rs/v0.5-rc/guide/state/
⭐⭐⭐
配置:
https://rocket.rs/v0.5-rc/guide/configuration/
hhstore
commented
2 years ago
Rocket 实践案例:
说明:
大量生产级别的 rust web 项目, 都是基于 rocket.
质量和可靠性无需怀疑.
项目:
https://github.com/safe-global/safe-client-gateway
⭐ ⭐ ⭐ ⭐
https://github.com/dani-garcia/vaultwarden
⭐ ⭐ ⭐ ⭐
https://github.com/svenstaro/rust-web-boilerplate
hhstore
commented
2 years ago
Rocket 插件集成:
Swagger:
https://github.com/GREsau/okapi
https://crates.io/crates/rocket_okapi
https://crates.io/crates/rocket_okapi_codegen
hhstore
commented
2 years ago
1
related: