water_http-1.3.1 has been yanked.
Water Http Framework is the most easy and fast web framework that built on both http1.1 and http2 and it`s supporting them automatically [no extra implementations required]
so lets talk about installing firstly
- you need to add water_http crate, and we recommend you to use the terminal or CMD in windows
cargo add water_http
or you could use cargo.toml file and add the latest version of water_http
="[latest_version_number]"
- then you need to add tokio
cargo add tokio --features=full
- (optional) if you wants to use json structs just add serde and serde_json crates
cargo serde serde_json
Now Let`s implement Rust Code
- first implementation
use HashMap;
use ;
/// notice that this data holder could be used to parse data from middleware to another or
/// from controller to controller , so you could choose what ever you want from data type ,
/// or you could make it u8 to have single byte if you don`t use it
DataHolderInitializer!;
async
WaterController!
- second one
use HashMap;
use ;
/// notice that this data holder could be used to parse data from middleware to another or
/// from controller to controller , so you could choose what ever you want from data type ,
/// or you could make it u8 to have single byte if you don`t use it
DataHolderInitializer!;
async
WaterController!
- third one
use HashMap;
use ;
/// notice that this data holder could be used to parse data from middleware to another or
/// from controller to controller , so you could choose what ever you want from data type ,
/// or you could make it u8 to have single byte if you don`t use it
DataHolderInitializer!;
async
WaterController!
- forth
use HashMap;
use ;
// notice that this data holder could be used to parse data from middleware to another or
// from controller to controller , so you could choose what ever you want from data type ,
// or you could make it u8 to have single byte if you don`t use it
DataHolderInitializer!;
async
WaterController!
// notice that when you set new water controller you are creating new mod , so you need to either use extra_code
// to add your wanted code or use [super::*] or [crate::*]
WaterController!
// notice that when you set new water controller you are creating new mod , so you need to either use extra_code
// to add your wanted code or use [super::*] or [crate::*]
WaterController!
and there is a lot of features like downloading files and setting public directory and streaming videos and sending many files as response and sending customs responses and also setting custom ip addresses that would be only them who can connect the server or restricting ip addresses from connecting the server and also there is cli application and very easy frontend building tools are coming soon
use WaterServerConfigurations;
let mut config = default;
config.public_files_path = Stringfrom;
config.restricted_ips = Some;
config.set_tls_certificate;
// for prevent downloading public files from public directory
config.do_not_even_check_public_resources = true;