loadstar 0.0.7

A simple web framework for rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tiny_http::Request;

use crate::controller::Controller;

pub trait Router {
    fn new() -> Self;
    fn route(&self, request: Request);
    fn add_controller(&mut self, controller: impl Controller)
    where
        Self: Sized,
    {
        controller.register_routes(self);
    }
    fn add_route(&mut self, route: &str, route_function: fn(Request));
}