1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use http::Method;
use oasgen_core::{OaSchema};
use crate::Server;


impl Server<()> {
    pub fn none() -> Self {
        Self::new()
    }

    pub fn get<F>(mut self, path: &str, handler: F) -> Self {
        self.add_handler_to_spec(path, Method::GET, &handler);
        self
    }

    pub fn post<F>(mut self, path: &str, handler: F) -> Self {
        self.add_handler_to_spec(path, Method::POST, &handler);
        self
    }
}