config_simple 0.1.1

It's a simple rosette server to smart_house
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::fs;

pub struct ConfigServer {
    pub url: String,
}

impl ConfigServer {
    pub fn new(host: String, port: String) -> Result<ConfigServer, String> {
        Ok(Self {
            url: fs::read_to_string("settings/addr")
                .unwrap_or_else(|_| format!("{}:{}", host, port)),
        })
    }
}