rum_framework 0.0.1

A toy web framework inspired by gin-gonic and express-js.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub(crate) struct Response {
    pub(crate) http_status: String,
    pub(crate) response_body: String,
}

impl Response {
    pub(crate) fn get_response(&self, http_ver: &str, response_header: String) -> (String, String) {
        return (
            format!(
                "{} {}\r\n{}\r\n{}",
                http_ver, self.http_status, response_header, self.response_body
            ),
            self.http_status.clone(),
        );
    }
}