)
( /( ( (
)\())( ( )\))(
((_)\ )\ )\ )((_))\
| |(_|(_)_(_/( (()(_)
| / / _ \ ' \)) _` |
|_\_\___/_||_|\__, |
secure web node |___/ v0.1.0
kong
exampleuse kong::{json, kroute, server, Kong, Kontrol, Method};
fn main() {
// start kong router, kontrolling provided endpoint kontrollers
vec![Box::new(HelloKontroller {
kroute(: "/hello".to_string(),
address: Method::Get,
method})]);
}
/// Hello API endpoint controller
struct HelloKontroller {
/// Endpoint address
: String,
address/// Endpoint HTTP method
: Method,
method}
impl Kontrol for HelloKontroller {
fn address(&self) -> String {
self.address.clone()
}
fn method(&self) -> Method {
self.method
}
fn kontrol(&self, _kong: &Kong) -> server::Response {
let res = json!({ "message": "Hello World" });
server::Response::json(&res).with_status_code(200)
}
}
kong
Roadmap0.1.0
0.2.0
0.3.0
0.4.0
0.5.0
0.6.0
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
Written and placed in the public domain by Jackson G. Kaindume.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.
For more information, please refer to the UNLICENSE file in the repository.
π https://kong.kwatafana.org/ | π§ cy6erlion@protonmail.com