You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tide is a minimal and pragmatic Rust web application framework built for
rapid development. It comes with a robust set of features that make building
async web applications and APIs easier and more fun.
Getting started
In order to build a web app in Rust you need an HTTP server, and an async
runtime. After running cargo init add the following lines to your
Cargo.toml file:
# Example, use the version numbers you needtide = "0.17.0"async-std = { version = "1.8.0", features = ["attributes"] }
serde = { version = "1.0", features = ["derive"] }
Examples
Create an HTTP server that receives a JSON body, validates it, and responds
with a confirmation message.
use tide::Request;use tide::prelude::*;#[derive(Debug,Deserialize)]structAnimal{name:String,legs:u16,}#[async_std::main]asyncfnmain() -> tide::Result<()>{letmut app = tide::new();
app.at("/orders/shoes").post(order_shoes);
app.listen("127.0.0.1:8080").await?;Ok(())}asyncfnorder_shoes(mutreq:Request<()>) -> tide::Result{letAnimal{ name, legs } = req.body_json().await?;Ok(format!("Hello, {}! I've put in an order for {} shoes", name, legs).into())}
To add a link to this list, edit the markdown
file and
submit a pull request (github login required) Listing here
does not constitute an endorsement or recommendation from the tide
team. Use at your own risk.
Clean boilerplate for graphql services using tide, rhai, async-graphql, surf, graphql-client, handlebars-rust, jsonwebtoken, and mongodb.
Graphql Services: User register, Salt and hash a password with PBKDF2 , Sign in, JSON web token authentication, Change password, Profile Update, User's query & mutation, and Project's query & mutation.
Web Application: Client request, bring & parse GraphQL data, Render data to template engine(handlebars-rust), Define custom helper with Rhai scripting language.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
About
Fast and friendly HTTP server framework for async Rust