mrps 0.1.0

Mini reverse proxy server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use minijinja::Value;
use std::error::Error;
use serde::Deserialize;
use std::collections::HashMap;
use serde_derive::Deserialize;

#[derive(Deserialize)]
pub struct Modify {
    pub status: Option<u16>,
    pub headers: Option<HashMap<String, String>>
}

impl Modify {
    pub fn new (modify: &Value) -> Result<Modify, Box<dyn Error>> {
        Ok(Modify::deserialize(modify)?)
    }
}