add mock server

This commit is contained in:
appflowy
2021-12-13 13:55:44 +08:00
parent df432d11c3
commit 31086ad4df
51 changed files with 423 additions and 292 deletions

View File

@ -10,7 +10,7 @@ use tera::Tera;
use walkdir::WalkDir;
pub fn read_file(path: &str) -> Option<String> {
let mut file = File::open(path).expect(&format!("Unable to open file at {}", path));
let mut file = File::open(path).unwrap_or_else(|_| panic!("Unable to open file at {}", path));
let mut content = String::new();
match file.read_to_string(&mut content) {
Ok(_) => Some(content),