aphrora 0.2.0

A simple server frame developed in Rust, it can also be used to build up GUI via webpages for rust applications.
Documentation
1
2
3
4
5
6
7
8
9
10
use std::fs;

/// Try get pages file under a root path,
/// which enable approach to different pages easier.
pub fn try_under_root(root_path: &str, file_path: &str) -> Option<String> {
    match fs::read_to_string(root_path.to_owned() + file_path) {
        Ok(file_string) => Option::Some(file_string),
        Err(_) => Option::None,
    }
}